2013-05-10 16 views
1

使用R軟件包MuMIn(v1.9.5)和命令dredge時,beta = TRUE切換器不再按預期運行。無法使用MuMIn軟件包返回貝爾係數R

# load Cement data set with MuMIn package 
data(Cement) 

# build global model 
fmd <- lm(y ~ X1 + X2 + X3 + X4, data = Cement) 

# dredge global model without returning standardized coefficients (default); 
# WORKING 

ms1 <- dredge(fmd) 

# dredge global model and return standardized coefficients; 
# NOT WORKING 

ms1 <- dredge(fmd, beta = TRUE) 

後者返回:

Error in dimnames(ret) <- list(names(model$coefficients), c("Estimate", : 
    length of 'dimnames' [1] not equal to array extent 

基於R V3.0.0

回答

1

與牧民1.9.5確認......它看起來像有在beta.weights()功能的錯誤。

第四行,

coefmat <- coefTable(model)[, 1L:2L] 

應該

coefmat <- coefTable(model)[, 1L:2L, drop=FALSE] 

您可以修復自己這一點,是暫時的,如下:

fix(beta.weights) 
## opens an editor; make the change in the editor and save/exit 
assignInNamespace("beta.weights",beta.weights,"MuMIn") 

但是,它肯定是一個好主意聯繫包維護者(見help(package="MuMIn")並提交錯誤報告...

相關問題