Hi everyone
I am battling to reproduce Genstat anova results in R - I'm confident I have run the analyses correctly in Genstat and would like to learn to do the same analyses in R.
I have a field trial that is set up as a 2-factor randomised design with 3 reps. The Genstat output is as follows:
Source of variation d.f. (m.v.) s.s. m.s. v.r. F pr.
Rep stratum 2 14.775 7.387 6.14
Rep.*Units* stratum
Treatment 3 26.227 8.742 7.27 0.005
Depth 1 27.294 27.294 22.70 <.001
Treatment.Depth 3 1.823 0.608 0.51 0.686
Residual 12 (2) 14.428 1.202
Total 21 (2) 77.3
The R script I used was:
mod1 <- aov(
CNS Total % C
~ Rep + Treat * Depth , data = df)
summary(mod1)
And this is the output:
Df Sum Sq Mean Sq F value Pr(>F)
Rep 2 18.223 9.111 7.578 0.007444 **
Treat 3 19.108 6.369 5.298 0.014761 *
Depth 1 23.878 23.878 19.861 0.000784 ***
Treat:Depth 3 1.663 0.554 0.461 0.714632
Residuals 12 14.428 1.202
I'm not convinced I'm managing the reps correctly in R. Any advice would be so appreciated!