data(VocabGrowth)
# Standard Multivariate & Univariate repeated measures analysis
Vocab.mod <- lm(cbind(grade8,grade9,grade10,grade11) ~ 1, data=VocabGrowth)
idata <-data.frame(grade=ordered(8:11))
Anova(Vocab.mod, idata=idata, idesign=~grade)
# calculate Y M, using polynomial contrasts
trends <- as.matrix(VocabGrowth) %*% poly(8:11, degree=3)
colnames(trends)<- c("Linear", "Quad", "Cubic")
# test all trend means = 0 == Grade effect
within.mod <- lm(trends ~ 1)
Manova(within.mod)
heplot(within.mod, terms="(Intercept)", col=c("red", "blue"), type="3",
term.labels="Grade",
main="HE plot for Grade effect")
points(0,0, cex=2.5, col="green", pch=19)
text(0,0, expression(H[0]), col="green", pos=2)
abline(h=0, col="green")
abline(v=0, col="green")
Run the code above in your browser using DataLab