Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
lmList オブジェクトから係数を抽出する次のコードがあります。
library(lme4) library(plyr) lm.model <- lmList(Y ~ X | eventID, df) param <- ldply(lm.model, coef)
このコードは正常に動作しています。しかし、これは係数を抽出する効率的な方法ですか?
私の主な質問は、同じ lm.model オブジェクトから RMSE を抽出するにはどうすればよいですか?
この場合、係数を取得するために ldply は必要ありません (単純に coef(lm.model) を使用できます)。残差標準誤差を取得するには:
ldply(slot(lm.model,".Data"),function(x) summary(x)$sigma)