[R] aov p values for levels of a factor.

Dieter Menne dieter.menne at menne-biomed.de
Sat Aug 15 17:14:18 CEST 2009

John Sorkin wrote:
> I am running an balanced aov, in which Time has 4 levels, Group has 2
> levels:
> fit2<-aov(Post ~ as.factor(Time)
> +as.factor(Group)+as.factor(Group*Time)+Error(SS), alldata)
> I would like to get a p value for each level of time, each level of
> Group and each level of Group*Time. How can I do this? I get this, which
> appears to be omnibus p values for the factors:

Whatever method you use, I recommend to convert to factors in the data frame
and leave out the as.factor, because contrast can look messy otherwise and
you could be caught by typos when defining these.

For lm, use estimable in package gmodels; after a slight reformulation, you
could also use contrast in Frank Harrell's Design package.


View this message in context: http://www.nabble.com/aov---p-values-for-levels-of-a-factor.-tp24977991p24985429.html
Sent from the R help mailing list archive at Nabble.com.

More information about the R-help mailing list