tags:

views:

61

answers:

1

The following script

#!/usr/bin/Rscript --vanilla
x <- c(4.5,6.4,7.2,6.7,8.8,7.8,9.6,7.0,5.9,6.8,5.7,5.2)
fertilizer<- factor(c('A','A','A','A','B','B','B','B','C','C','C','C'))
crop <- factor(c('I','II','III','IV','I','II','III','IV','I','II','III','IV'))
av <- aov(x~fertilizer*crop)
summary(av)

yields

                Df  Sum Sq Mean Sq
fertilizer       2 13.6800  6.8400
crop             3  2.8200  0.9400
fertilizer:crop  6  6.5800  1.0967

For other data, aov usually gives the F-statistic and associated p-value. What is wrong/special about this data that causes R to omit the juicy parts?

+2  A: 

Should you using + instead of * in the formula?

> summary(aov(x~fertilizer + crop))
            Df  Sum Sq Mean Sq F value  Pr(>F)  
fertilizer   2 13.6800  6.8400  6.2371 0.03426 *
crop         3  2.8200  0.9400  0.8571 0.51218  
Residuals    6  6.5800  1.0967                  
---
Signif. codes:  0 ‘***’ 0.001 ‘**’ 0.01 ‘*’ 0.05 ‘.’ 0.1 ‘ ’ 1 
Tristan
Just to expound: using * is OK in general, but here there are no degrees of freedom to estimate the error if the interaction term is included.
Aniko
Thanks for the help, Tristan and Aniko. I was misunderstanding what * meant...
unutbu