ASC
ASC

Reputation: 57

Extracting RMSE from a lmList object

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

Answers (1)

Wojciech Sobala
Wojciech Sobala

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

Related Questions