Two-factor anova with replication

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!

I found the ANOVA tutorial on Datanovia very helpful. Maybe check it out?

https://www.datanovia.com/en/lessons/anova-in-r/

I think blocking is handled in mixed effects models.

https://www.datanovia.com/en/lessons/mixed-anova-in-r/

This topic was automatically closed 21 days after the last reply. New replies are no longer allowed.

If you have a query related to it or one of the replies, start a new topic and refer back with a link.

Thanks so much. I did look at the Datanovia tutorials, but there doesn't seem to be anything about blocking - it appears blocks are included as an additional factor in R script, which definitely doesn't give the same results as a Genstat anova, where reps are included as a blocking factor and not a treatment factor. My knowledge of stats (and R) isn't good enough to know what Genstat does, or how to manage the computation with replication. Thanks again!