Run an ANOVA using the by function to split by factor?


Im trying to run an analysis to establish the effect of three different training programmes on sprint speed (This initial ANOVA is below). Furthermore, I need to establish whether there is a different effect of the programmes for boys and for girls. How do I incorporate my 'Gender' variable into this code in order to split the analysis for boys and girls? I understand the by() function allows you to split by factors. But, don't understand how to work it into an ANOVA.

Sprint7<-aov(Postsprint ~ Prog, data = Sprint)
Anova(Sprint7, Type = "III")
summary (Sprint7)

Created on 2020-03-22 by the reprex package (v0.3.0)

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