Hi all,
I found that in R, when applying aov() to 3 or more groups of data, even there is only one observation in some group, aov() still works. I am not sure how it calculate the within-group variance for this group without any replicates, such as the group z in the following code:
x<-rnorm(mean=5,10) y<-rnorm(mean=10,10) z<-20 f<-factor(c(rep('x',10),rep('y',10),'z')) summary(lm(aov(c(x,y,z)~f)))
The output is:
Call:
lm(formula = aov(c(x, y, z) ~ f))
Residuals:
Min 1Q Median 3Q Max
-1.41996 -0.51930 -0.04419 0.41832 1.75994
Coefficients:
Estimate Std. Error t value Pr(>|t|)
(Intercept) 4.710 0.304 15.49 7.52e-12 ***
fy 5.018 0.430 11.67 7.89e-10 ***
fz 15.290 1.008 15.16 1.07e-11 ***
---
Signif. codes: 0 ‘***’ 0.001 ‘**’ 0.01 ‘*’ 0.05 ‘.’ 0.1 ‘ ’ 1
Residual standard error: 0.9614 on 18 degrees of freedom
Multiple R-squared: 0.9442,
Adjusted R-squared: 0.938
F-statistic: 152.3 on 2 and 18 DF, p-value: 5.254e-12
In the result, group z has a p-value (in the row fz). I am curious if this p-value makes any sense.