library(lme4)
fm1 <- lmer(Reaction ~ Days + (Days | Subject), sleepstudy)
The notation (Days | Subject)
says to allow the intercept and Days
to vary randomly for each level of Subject
.
Can you please explain me the result of the following commands ?
attr(summary(fm1)$varcor$Subject,"stddev")
(Intercept) Days
24.740448 5.922133
c(sd(ranef(fm1)$Subject[,1]),sd(ranef(fm1)$Subject[,2]))
[1] 21.595943 5.455217
summary(fm1)$sigma
[1] 25.59182
residuals(summary(fm1))
sd(residuals(summary(fm1)))
[1] 0.9183965
What is the INTERPRETATION of the results found from various commands?
That is , if one asks me what is the meaning of the results that you have found from sd(ranef(fm1)$Subject[,1])
and attr(summary(fm1)$varcor$Subject,"stddev")[1]
? Both are standard deviation of Intercept
but of course there is difference between these two results . But I don't know what is this ?
In ?getMe
, it is said that from summary(fm1)$sigma
, we found residual standard error . But why doesn't the result match with sd(residuals(summary(fm1)))
?
Also , In summary(fm1)$varcor
there is value 0.066 under the column Corr
. Does it mean correlation between two random effects (Intercept)
and Days
is 0.066 ?
Any help is appreciated . Thank you .
sd(residuals(fm1))
and notsd(residuals(summary(fm1))
. $\endgroup$