A one-way ANOVA (“analysis of variance”) compares the means of three or more independent groups to determine if there is a statistically significant difference between the corresponding population means.
This tutorial explains how to perform a one-way ANOVA by hand.
Example: One-Way ANOVA by Hand
Suppose we want to know whether or not three different exam prep programs lead to different mean scores on a certain exam. To test this, we recruit 30 students to participate in a study and split them into three groups.
The students in each group are randomly assigned to use one of the three exam prep programs for the next three weeks to prepare for an exam. At the end of the three weeks, all of the students take the same exam.
The exam scores for each group are shown below:
Use the following steps to perform a one-way ANOVA by hand to determine if the mean exam score is different between the three groups:
Step 1: Calculate the group means and the overall mean.
First, we will calculate the mean for all three groups along with the overall mean:
Step 2: Calculate SSR.
Next, we will calculate the regression sum of squares (SSR) using the following formula:
nΣ(Xj – X..)2
where:
- n: the sample size of group j
- Σ: a greek symbol that means “sum”
- Xj: the mean of group j
- X..: the overall mean
In our example, we calculate that SSR = 10(83.4-85.8)2 + 10(89.3-85.8)2 + 10(84.7-85.8)2 = 192.2
Step 3: Calculate SSE.
Next, we will calculate the error sum of squares (SSE) using the following formula:
Σ(Xij – Xj)2
where:
- Σ: a greek symbol that means “sum”
- Xij: the ith observation in group j
- Xj: the mean of group j
In our example, we calculate SSE as follows:
Group 1: (85-83.4)2 + (86-83.4)2 + (88-83.4)2 + (75-83.4)2 + (78-83.4)2 + (94-83.4)2 + (98-83.4)2 + (79-83.4)2 + (71-83.4)2 + (80-83.4)2 = 640.4
Group 2: (91-89.3)2 + (92-89.3)2 + (93-89.3)2 + (85-89.3)2 + (87-89.3)2 + (84-89.3)2 + (82-89.3)2 + (88-89.3)2 + (95-89.3)2 + (96-89.3)2 = 208.1
Group 3: (79-84.7)2 + (78-84.7)2 + (88-84.7)2 + (94-84.7)2 + (92-84.7)2 + (85-84.7)2 + (83-84.7)2 + (85-84.7)2 + (82-84.7)2 + (81-84.7)2 = 252.1
SSE: 640.4 + 208.1 + 252.1 = 1100.6
Step 4: Calculate SST.
Next, we will calculate the total sum of squares (SST) using the following formula:
SST = SSR + SSE
In our example, SST = 192.2 + 1100.6 = 1292.8
Step 5: Fill in the ANOVA table.
Now that we have SSR, SSE, and SST, we can fill in the ANOVA table:
Source | Sum of Squares (SS) | df | Mean Squares (MS) | F |
---|---|---|---|---|
Treatment | 192.2 | 2 | 96.1 | 2.358 |
Error | 1100.6 | 27 | 40.8 | |
Total | 1292.8 | 29 |
Here is how we calculated the various numbers in the table:
- df treatment: k-1 = 3-1 = 2
- df error: n-k = 30-3 = 27
- df total: n-1 = 30-1 = 29
- MS treatment: SST / df treatment = 192.2 / 2 = 96.1
- MS error: SSE / df error = 1100.6 / 27 = 40.8
- F: MS treatment / MS error = 96.1 / 40.8 = 2.358
Note: n = total observations, k = number of groups
Step 6: Interpret the results.
The F test statistic for this one-way ANOVA is 2.358. To determine if this is a statistically significant result, we must compare this to the F critical value found in the F distribution table with the following values:
- α (significance level) = 0.05
- DF1 (numerator degrees of freedom) = df treatment = 2
- DF2 (denominator degrees of freedom) = df error = 27
We find that the F critical value is 3.3541.
Since the F test statistic in the ANOVA table is less than the F critical value in the F distribution table, we fail to reject the null hypothesis. This means we don’t have sufficient evidence to say that there is a statistically significant difference between the mean exam scores of the three groups.
Bonus Resource: Use this One-Way ANOVA Calculator to automatically perform a one-way ANOVA for up to five samples.