16.3. ANOVA Concepts#

Analysis of Variance (ANOVA) is a test of independence where the outcome variable is continuous, and the explanatory variable is categorical. It is a way of comparing means across groups and is preferred where there are more than two groups. If we ran an experiment with three groups – say treatment1, treatment2, and control group - ANOVA enables the researcher to test the means of these three groups simultaneously.

  • If there were only two groups, which test would you use to compare means?

  • Why is a comparison of means called Analysis of Variance?

Look at the example dataset below, from Agresti and Finlay (Figure 12.1)

https://raw.githubusercontent.com/jillxoreilly/StatsCourseBook/main/images/regression4_AgrestiDataset.png

The means of the three groups in a are clearly different to each other.

In b there is more overlap between the data points, and it is harder to tell just by eyeballing the data whether there is a difference in means in the three groups.

In this example, the means of the three groups, and the overall mean, are the same in a and b which means that the variability between groups is the same in a and b. However, the variability within groups is lower in a than in b. Low variability within groups suggests that the groups have means that are statistically different to each other.

ANOVA uses the $F$-statistic to test whether there are significant differences in means across groups. The $F$-statistic is a ratio of the between-groups variance divided by the within-group variance as follows:

$$ F = \frac{\textrm{Between-groups estimate of variance } σ^2}{\textrm{Within-groups estimate of variance } σ^2} $$

  • What does it mean when the $F$-statistic is large?

  • What are the assumptions of ANOVA?

  • What is the non-parametric equivalent of ANOVA?