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.
Thank you Zack, well done. I am going to use your example for a graduate student struggling to understanding the concept of ANOVA….
John Padgett PhD
Very helpful for me to learn as a student
thankyou for the lesson. I’ve learned a lot
what is the IV and the DV in this example?
Thanks Zach. This was very helpful.
Think there is an issue with how you are calculating the F statistic. You say that to calculate MS treatment: SST / df treatment = 192.2 / 2 = 96.1. However you are plugging in 192.2 and not the 1292.8 that you calculated for SST. This effects the final result.
MS treatment: SST / df treatment = 192.2 / 2 = 96.1
Should be:
MS treatment: SSR / df treatment = 192.2 / 2 = 96.1
THANK YOU VERY MUCH. I REALLY UNDRESTOOD THIS STEPWISE EXPLANATION
The question in my mind was solved by your explanation in this section.
I am glad to say thank you!
Good afternoon
I’ve got an assignment regards One way analysis of variance& I’m struggling with it
Please assist me
Wow, this is so much informative. The concepts and steps are clearly explained and it is generally easier to understand
Is the formula for SSR correct? Some sources say it’s not multiplied by n.
NVM, I double-checked with Walpole. It’s the same.
This has been more than resourceful to me , I can’t express my applause by word of mouth
I like this presentation of calculation of O e Way ANOVA by hand or manually.
I can easily teach my students taking up research.
Thank you so much.
I need help with my psych2 class. ANOVA-Quiz. Can you take this 12 question quiz for a fee
how did you come up with that f critical value of 3.3541? Where is that coming from?
This Write up made me remember what I had forgotten, even my lecturer, having done my coursework in 2007.
Thanks, this is good work.
Well simplified for easier understanding of the complex subject.
This was truly amazing. Super easy to follow and super easy to understand and apply to our own data. You really saved my math IA. Thank you so much!
clear and understandable
For everyone “SST” here stands for “Sum of Squares of Treatment”, not Total, so what should normally be SSR
Similarly MST is “Treatment”, normally written as MSR for Regression
Hi Bill…In your case, if “SST” stands for “Sum of Squares of Treatment” (instead of the usual “Sum of Squares Total”), and “MST” stands for “Mean Square of Treatment” (normally written as “MSR” for Regression), here’s how you can adjust your interpretation and calculations.
Typically, in regression or ANOVA, these terms are used:
– **SST (Sum of Squares for Treatment)**: Measures the variability due to the treatment (or model). This is usually referred to as SSR (Sum of Squares for Regression).
– **SSE (Sum of Squares for Error)**: Measures the variability due to error (or residuals).
– **SST (Sum of Squares Total)**: The total variability in the data. This is sometimes confusingly written the same as the treatment sum of squares, but in your case, “SST” refers to treatment only.
To adjust your calculations:
– **SSR (Sum of Squares for Regression)** should be what you’re calling **SST (Sum of Squares of Treatment)**.
– **MSR (Mean Square for Regression)** should be equivalent to **MST (Mean Square of Treatment)**.
In statistical notation, this would look like:
1. **SST (Treatment) = SSR (Regression)**:
\[
\text{SSR} = \sum (\hat{y}_i – \bar{y})^2
\]
Where \( \hat{y}_i \) is the predicted value and \( \bar{y} \) is the mean of the observed values.
2. **MST (Treatment) = MSR (Regression)**:
\[
\text{MSR} = \frac{\text{SSR}}{p}
\]
Where \( p \) is the number of predictors (or treatments).
If you are following this scheme, your **SST** and **MST** would essentially refer to what others call **SSR** and **MSR**.
### General Terminology Clarification
– **SSR** (Sum of Squares for Regression/Treatment): Refers to the variability explained by the model.
– **SSE** (Sum of Squares for Error): Refers to the unexplained variability (errors/residuals).
– **SST** (Sum of Squares Total): The total variability in the dataset (not to be confused with your definition of SST).
Thus, just keep in mind this slight difference in terminology depending on the context (treatment in ANOVA versus regression). Does this clarify things for you?