[R] model simplification in repeated anova

Richard M. Heiberger rmh at temple.edu
Mon Jan 15 18:25:05 CET 2007


summary(npk.aovE)
summary(np.k.aovE)
## The block stratum has the same total in both summaries.
## In this example, the two suppressed interactions are last and
## both are not significant.

## In order to use anova(model.1, model.2), it is necessary to
## rewrite the SAME models without the Error function.
## Use terms( , keep.order=TRUE) and the dummy variables that were
## generated in the multi-stratum model.

npk.proj <- proj(npk.aovE)
npk.x <- npk.proj$block[,"N:P:K"]

npk.aov <- aov(terms(yield ~  npk.x + block + N+P+K+N:P+N:K+P:K, keep.order=TRUE), npk)

np.k.aov <- aov(terms(yield ~  block + N+P+K+N:P, keep.order=TRUE), npk)

summary(npk.aov)
summary(np.k.aov)

anova(npk.aov, np.k.aov)



More information about the R-help mailing list