[R] ANOVA 1 too few degrees of freedom
Rovinpiper
david.j.meehan at gmail.com
Tue May 3 21:37:31 CEST 2011
I'm running an ANOVA on some data for respiration in a forest. I am having a
problem with my degrees of freedom. For one of my variables I get one fewer
degrees of freedom than I should.
I have 12 plots and I therefore expected 11 degrees of freedom, but instead
I got 10.
Any ideas?
I have some code and output below:
> class(Combined.Plot)
[1] "character"
> levels(as.factor(Combined.Plot))
[1] "60m" "A1" "B1" "B3" "B4" "C5" "C9" "D2" "D9" "F60m"
"F8" "Q7"
> nlevels(as.factor(Combined.Plot))
[1] 12
> Anova.Trt.D.M.T.Pr.Model <- aov(Combined.Rs~Combined.Trt +
> as.factor(Combined.Plot) + as.factor(Combined.Day) +
> Combined.Trt*as.factor(Combined.Day) +
> Combined.Plot*as.factor(Combined.Day))
Warning message:
In model.matrix.default(mt, mf, contrasts) :
variable 'Combined.Plot' converted to a factor
> summary(Anova.Trt.D.M.T.Pr.Model)
Df Sum Sq
Mean Sq F value Pr(>F)
Combined.Trt 1 52.80
52.805 2.0186e+30 < 2.2e-16 ***
as.factor(Combined.Plot) 10 677.69 67.769
2.5907e+30 < 2.2e-16 ***
as.factor(Combined.Day) 16 2817.47 176.092
6.7317e+30 < 2.2e-16 ***
Combined.Trt:as.factor(Combined.Day) 16 47.82 2.989
1.1426e+29 < 2.2e-16 ***
as.factor(Combined.Day):Combined.Plot 160 611.21 3.820 1.4604e+29 <
2.2e-16 ***
Residuals 204 0.00
0.000
---
Signif. codes: 0 ‘***’ 0.001 ‘**’ 0.01 ‘*’ 0.05 ‘.’ 0.1 ‘ ’ 1
--
View this message in context: http://r.789695.n4.nabble.com/ANOVA-1-too-few-degrees-of-freedom-tp3493349p3493349.html
Sent from the R help mailing list archive at Nabble.com.
More information about the R-help
mailing list