I have been reading a good book called Applied Longitudinal Data Analysis: Modeling Change and Event Occurrence by Judith Singer and John Willet. The book shows that by modeling in 2 levels, we can model the individual change in level 1 and in level 2 model for systematic interindividual differences in change.
The R codes for the examples only show how to use lme()
to estimate the fixed and random effects. However, the text suggested that we should test the variance components to determine whether the random effects are significant or not.
For example, one of the codes does only the following:
library(nlme)
model.a <- lme(alcuse~ 1, alcohol1, random= ~1 |id)
summary(model.a)
Linear mixed-effects model fit by REML
Data: alcohol1
AIC BIC logLik
679.0049 689.5087 -336.5025
Random effects:
Formula: ~1 | id
(Intercept) Residual
StdDev: 0.7570578 0.7494974
Fixed effects: alcuse ~ 1
Value Std.Error DF t-value p-value
(Intercept) 0.9219549 0.09629638 164 9.574139 0
Standardized Within-Group Residuals:
Min Q1 Med Q3 Max
-1.8892070 -0.3079143 -0.3029178 0.6110925 2.8562135
Number of Observations: 246
Number of Groups: 82
But the text lists the following:
- fixed effect: 0.922*** (s = 0.096) -> available in the output
- within person variance: 0.562*** (s = 0.062) -> can be obtained from the output (random effect residual std. dev squared)
- between person variance: 0.564*** (s = 0.119)
My work involves a lot of analysis for longitudinal data so I really need to understand this idea. Your help is very much appreciated.