14.1 4 Steps to conduct an ANOVA
Here are the 4 steps you should follow to conduct a standard ANOVA in R:
- Create an ANOVA object using the
aov()
function. In theaov()
function, specify the independent and dependent variable(s) with a formula with the formaty ~ x1 + x2
where y is the dependent variable, and x1, x2 … are one (more more) factor independent variables.
- Create a summary ANOVA table by applying the
summary()
function to the ANOVA object you created in Step 1.
- If necessary, calculate post-hoc tests by applying a post-hoc testing function like
TukeyHSD()
to the ANOVA object you created in Step 1.
- If necessary, interpret the nature of the group differences by creating a linear regression object using
lm()
using the same arguments you used in theaov()
function in Step 1.