[R] Fwd: model simplification in repeated anova

Michael Greeff michael.greeff at env.ethz.ch
Wed Jan 17 17:24:28 CET 2007


Hi,

I tried to do a model simplification in a repeated anova with 3  
factors (population,treatment,site). I tried to get rid of some  
interactions. Obviously it's not possible to use the function "anova"  
straight away to compare the different models. I got the suggestion  
to use the function proj (see below). In my data, however, I have in  
"block" not the third order interaction (n:p:k), but two factors and  
their interaction (population, site, population:site).

I somehow didn't manage to get the right aov after the projection.



> From: "Richard M. Heiberger" <rmh at temple.edu>
>
>
> npk.aovE <- aov(yield ~  N*P*K + Error(block), npk)
>
> np.k.aovE <- aov(yield ~  N*P+K + Error(block), npk)
>
>
> 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