1

R パッケージMuMIn (v1.9.5) とコマンドを使用するdredgeと、beta = TRUEスイッチが期待どおりに機能しなくなります。

# 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 の使用

4

1 に答える 1

1

MuMIN 1.9.5で確認・・・beta.weights()機能にバグがあるようです。

4行目、

 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")バグ レポートを参照して送信してください ...

于 2013-05-10T15:11:31.467 に答える