[R] Fwd: model simplification in repeated anova

From: Michael Greeff <michael.greeff_at_env.ethz.ch>
Date: Wed 17 Jan 2007 - 16:24:28 GMT


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@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)
>



R-help@stat.math.ethz.ch mailing list
https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide http://www.R-project.org/posting-guide.html and provide commented, minimal, self-contained, reproducible code. Received on Thu Jan 18 03:29:48 2007

Archive maintained by Robert King, hosted by the discipline of statistics at the University of Newcastle, Australia.
Archive generated by hypermail 2.1.8, at Wed 17 Jan 2007 - 17:30:24 GMT.

Mailing list information is available at https://stat.ethz.ch/mailman/listinfo/r-help. Please read the posting guide before posting to the list.