Skip to content

aov p values for levels of a factor.

2 messages · John Sorkin, Dieter Menne

#
Windows XP
R2.8.1

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:

Error: SS
                 Df Sum Sq Mean Sq
as.factor(Group)  1 12.918  12.918

Error: Within
                        Df  Sum Sq Mean Sq F value   Pr(>F)   
as.factor(Time)          3 19.8486  6.6162  7.5652 0.002601 **
as.factor(Group)         1  3.4074  3.4074  3.8961 0.067109 . 
as.factor(Group * Time)  3 11.0076  3.6692  4.1955 0.024195 * 
Residuals               15 13.1183  0.8746                    
---
Signif. codes:  0 ?***? 0.001 ?**? 0.01 ?*? 0.05 ?.?
0.1 ? ? 1 

Thanks,
John


John David Sorkin M.D., Ph.D.
Chief, Biostatistics and Informatics
University of Maryland School of Medicine Division of Gerontology
Baltimore VA Medical Center
10 North Greene Street
GRECC (BT/18/GR)
Baltimore, MD 21201-1524
(Phone) 410-605-7119
(Fax) 410-605-7913 (Please call phone number above prior to faxing)

Confidentiality Statement:
This email message, including any attachments, is for th...{{dropped:6}}
#
John Sorkin wrote:
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.

Dieter