str(Weights)
if (require("lme4", quietly = TRUE, character = TRUE)) {
options(contrasts = c(unordered = "contr.SAS", ordered = "contr.poly"))
## compare with output 3.1, p. 91
print(fm1Weight <- lmer(strength ~ Program * Time + (1|Subj), Weights))
print(anova(fm1Weight))
print(fm2Weight <- lmer(strength ~ Program * Time + (Time|Subj), Weights))
print(anova(fm1Weight, fm2Weight))
## Not run:
# intervals(fm2Weight)
# fm3Weight <- update(fm2Weight, correlation = corAR1())
# anova(fm2Weight, fm3Weight)
# fm4Weight <- update(fm3Weight, strength ~ Program * (Time + I(Time^2)),
# random = ~Time|Subj)
# summary(fm4Weight)
# anova(fm4Weight)
# intervals(fm4Weight)
# ## End(Not run)
}
Run the code above in your browser using DataLab