inst/mlbook/ch05.R

library(nlme)
# data(bdf)
## Model with random slope for IQ.ver.cen
## Compare with Table 5.1, p. 71.
fm5 <- lme(langPOST ~ IQ.ver.cen + avg.IQ.ver.cen,
           data = bdf, random = ~ IQ.ver.cen, method = "ML")
summary(fm5)
VarCorr(fm5)
-2 * c(logLik(fm5))                     # deviance
## Add centered class size and interaction
## Compare with Table 5.2, p. 75
fm6 <- update(fm5, langPOST ~ avg.IQ.ver.cen + IQ.ver.cen * grpSiz.cen)
summary(fm6)
VarCorr(fm6)
-2 * c(logLik(fm6))                     # deviance

Try the nlme package in your browser

Any scripts or data that you put into this service are public.

nlme documentation built on Nov. 27, 2023, 5:09 p.m.