Reputation: 57
I have the following code to extract the Coefficients from a lmList object.
library(lme4)
library(plyr)
lm.model <- lmList(Y ~ X | eventID, df)
param <- ldply(lm.model, coef)
This code is working OK. HOwever, is this an efficient way to extract the coefficients?
My main question is, how can I extract RMSE from the same lm.model object?
Upvotes: 1
Views: 1764
Reputation: 7561
In this case ldply is not necessary to get coefficients (you can simply use coef(lm.model)). To get residual standard error:
ldply(slot(lm.model,".Data"),function(x) summary(x)$sigma)
Upvotes: 1