Login
📚 Mostly Harmless Statistics
Chapters ▾
⇩ Download ▾

11.1 One-Way ANOVA

The z- and t-tests can be used to test the equality between two population means μ1 and μ2. When we have more than two groups, we would inflate the probability of making a type I error if we were to compare just two at a time and make a conclusion about all the groups together. To account for this P(Type I Error) inflation, we instead will do an analysis of variance (ANOVA) to test the equality between 3 or more population means μ1,μ2,μ3,,μk.

The F-test (for ANOVA) is a statistical test for testing the equality of k population means.

The one-way ANOVA F-test is a statistical test for testing the equality of k population means from 3 or more groups within one variable or factor. There are many different types of ANOVA; for now, we are going to start with what is commonly referred to as a one-way ANOVA, which has one main effect or factor that is split up into three or more independent treatment levels. In more advanced courses you would learn about dependent groups or two or more factors.

Assumptions:

The hypotheses for testing the equality of k population means (ANOVA) are set up with all the means equal to one another in the null hypothesis and at least one mean is different in the alternative hypothesis.

H 0 : μ 1 = μ 2 = μ 3 = = μ k

H1: At least one mean is different.

Even though there is equality in H0, the ANOVA test is testing if the variance between groups is significantly greater than the variance within groups; hence, this will always be set up as a right-tailed test.

We will be using abbreviations for many of the numbers found in this section.

B = Between, W = Within

MS = Mean Square (This is a variance)

MSB = Mean Square (Variance) Between groups.

MSW = Mean Square (Variance) Within groups.

The formula for the F-test statistic is F=MSBMSW.

Use the F-distribution with degrees of freedom from the between and within groups. The numerator degrees of freedom are equal to the number of groups minus one, that is numerator degrees of freedom are dfB=k1. The denominator degrees of freedom are equal to the total of all the sample sizes minus the number of groups, that is denominator degrees of freedom are dfW=Nk.

The sum of squares, degrees of freedom and mean squares are organized in a table called an ANOVA table. Figure 11-1 below is a template for an ANOVA table.

ANOVA table format and equations.
Figure 11-1: ANOVA table template.

Where:

χ¯i = sample mean from the ith group

si2 = sample variance from the ith group

ni = sample size from the ith group

k = number of groups

N=n1+n2++nk = sum of the individual sample sizes for groups

Grand mean from all groups = χ¯GM=χiN

Sum of squares between groups = SSB = ni(χ¯iχ¯GM)2

Sum of squares within groups = SSW = (ni1)si2

Mean squares between groups (or the between-groups variance sB2) = MSB=SSBk1

Mean squares within-group (or error within-groups variance sW2) = MSW=SSWNk

F=MSBMSW is the test statistic.

These calculations can be time-consuming to do by hand, so use technology to find the ANOVA table values, critical value and/or p-value.

Different textbooks and computer software programs use different labels in the ANOVA tables.

Assumption: The population we are sampling from must be approximately normal with equal variances. If these assumptions are not met there are more advanced statistical methods that should be used.

Summary

The ANOVA test gives evidence that there is a difference between three or more means. The null hypothesis will always have the means equal to one another versus the alternative hypothesis that at least one mean is different. The F-test results are about the difference in means, but the test is actually testing if the variation between the groups is larger than the variation within the groups. If this between group variation is significantly larger than the within groups then we can say there is a statistically significant difference in the population means. Hence, we are always performing a right-tailed F-test for ANOVA. Make sure to only compare the p-value with α and the test statistic to the critical value.

Adapted from Mostly Harmless Statistics by Rachel Webb (Portland State University), hosted on LibreTexts (stats.libretexts.org) and licensed under CC BY-SA 4.0. Changes were made. License: CC-BY-SA-4.0.