Jamovi Guide: ANOVA and Which Means Differ
This guide compares the means of three groups. Jamovi’s ANOVA table gives the sums of squares, the mean squares, and F, the same numbers you can work by hand from each group’s n, mean, and SD, along with a p-value. If the test rejects, post hoc tests compare the groups two at a time, with a Bonferroni correction for running three tests. The example uses the practice survey data, so if you follow along with that file open you should see the same numbers.
The worked example
The survey asked how many minutes you exercised yesterday (exercise_min) and your year in college (class_year).
Research question: among the students in the survey, does the amount they exercise differ by year in college?
- Explanatory variable: year in college, recoded into three levels: first-year, sophomore, and upperclass (juniors and seniors together).
- Response variable: minutes of exercise yesterday, a number.
\[H_0: \mu_{\text{first-year}} = \mu_{\text{sophomore}} = \mu_{\text{upperclass}} \qquad H_A: \text{at least one mean is different}\]
What you need
- Jamovi 2.7.38. Everything here is in Jamovi itself.
- The practice survey file, practice_survey.csv. Open it with the hamburger menu (three lines, top left), Open, then Browse.
Step 1: Filter and recode
These are the same two steps as in the expected counts and X² guide. If you still have that file open with both in place, skip to Step 2.
Filter. Click the Data tab, then Filters, and type:
class_year != "Non-degree seeking"The two non-degree students are too few to be their own group. Nobody skipped the exercise question, so 158 students remain.
Recode. Click the Variables tab, check the box for
class_yearonly, and click Transform. Name the new variableyear3, choose Create New Transform…, and type:IF($source == "First-year", "first-year", IF($source == "Sophomore", "sophomore", "upperclass"))
Check your work. The status bar should read Row count 160 and Filtered 2.
Step 2: Descriptives and the conditions
- Click Analyses → Exploration → Descriptives.
- Put
exercise_minin Variables andyear3in Split by.
| year3 | n | mean | SD |
|---|---|---|---|
| first-year | 70 | 67.214 | 52.396 |
| sophomore | 53 | 40.566 | 33.378 |
| upperclass | 35 | 48.571 | 35.492 |
Check the three conditions before running the test.
- Independence. Each student answered the survey once, on their own. The students were not a random sample of a larger group, so the results describe the students who answered.
- Normality. Each level has at least 30 students (the smallest is 35), so this condition is met even though exercise minutes are right-skewed. With a level under 30, check Box plot under Plots and look for extreme outliers.
- Equal variance. The largest SD divided by the smallest SD should be under 2. Here \(52.396 / 33.378 = 1.57\).
Step 3: SSG, SSE, and F by hand
Everything F needs is in the Descriptives table. Working it by hand shows where Jamovi’s numbers in Step 4 come from.
The grand mean is the mean of all 158 students. Weight each level’s mean by its n:
\[\bar{x} = \frac{70(67.214) + 53(40.566) + 35(48.571)}{158} = 54.15\]
SSG, the variation between the levels, has one term for each level: its n times the squared distance from its mean to the grand mean.
\[\begin{aligned} SSG &= \sum n_i(\bar{x}_i - \bar{x})^2 \\ &= 70(67.214 - 54.15)^2 + 53(40.566 - 54.15)^2 + 35(48.571 - 54.15)^2 \\ &= 11{,}947 + 9{,}780 + 1{,}089 = 22{,}816 \end{aligned}\]
SSE, the variation within the levels, also has one term for each level. Since \(s^2 = \sum(x - \bar{x})^2 / (n - 1)\), each level’s sum of squared distances from its own mean is \((n_i - 1)s_i^2\), so the SDs are all you need.
\[\begin{aligned} SSE &= \sum (n_i - 1)s_i^2 \\ &= 69(52.396)^2 + 52(33.378)^2 + 34(35.492)^2 \\ &= 189{,}429 + 57{,}933 + 42{,}829 = 290{,}191 \end{aligned}\]
The mean squares and F. There are \(k = 3\) levels and \(n = 158\) students.
\[MSG = \frac{SSG}{k - 1} = \frac{22{,}816}{2} = 11{,}408 \qquad MSE = \frac{SSE}{n - k} = \frac{290{,}191}{155} = 1{,}872.2\]
\[F = \frac{MSG}{MSE} = \frac{11{,}408}{1{,}872.2} = 6.09\]
The variation between the three means is about 6 times what we would expect from the variation within the levels alone.
Check your work. Your SSE may differ from Jamovi’s in the last few digits (290,191 here, 290,193 in Step 4), because the SDs in the Descriptives table are rounded. F should match to two decimal places.
Step 4: The ANOVA table
- Click Analyses → ANOVA, then choose ANOVA, the second item. Don’t choose One-Way ANOVA, the first item. It runs a different version of the test by default, and its F won’t match the one you work by hand.
- Put
exercise_minin Dependent Variable andyear3in Fixed Factors.
| Sum of Squares | df | Mean Square | F | p | |
|---|---|---|---|---|---|
| year3 | 22816 | 2 | 11408.1 | 6.0934 | .0028350 |
| Residuals | 290193 | 155 | 1872.2 |
The year3 row is SSG, with \(k - 1 = 2\) degrees of freedom. The Residuals row is SSE, with \(n - k = 158 - 3 = 155\). These match the hand work in Step 3. Each mean square is that row’s sum of squares divided by its df, and F = 11408.1 / 1872.2 = 6.09.
The p-value is the area to the right of 6.09 under the F curve with 2 and 155 degrees of freedom: \(p = 0.0028\). It is below α = 0.05, so we reject \(H_0\). At least one year’s mean is different from the others. The ANOVA doesn’t say which one.
Step 5: Which means differ
With three levels there are three pairs to compare. Running three tests instead of one raises the chance that at least one of them rejects by chance alone, so each p-value is multiplied by 3 (and capped at 1). That is the Bonferroni correction.
- In the same ANOVA, expand Post Hoc Tests. Move
year3to the box on the right. - Under Correction, check No correction and Bonferroni, and uncheck Tukey.
| pair | mean difference | p | p bonferroni |
|---|---|---|---|
| first-year − sophomore | 26.65 | 0.00091 | 0.0027 |
| first-year − upperclass | 18.64 | 0.039 | 0.117 |
| sophomore − upperclass | −8.01 | 0.397 | 1 |
Compare the p bonferroni column with 0.05. The p column is there so you can see what the correction did. Jamovi writes the first p-value as 9.0976e-4, scientific notation for 0.00091.
- First-year vs sophomore: p bonferroni = 0.0027, below 0.05. These two means differ.
- First-year vs upperclass: p = 0.039 before the correction, but 0.117 after. Taken alone it would have counted. As one of three tests, it doesn’t.
- Sophomore vs upperclass: 1, no evidence of a difference.
Conclusion: among the students who answered the survey, the mean minutes of exercise differ by year in college. First-years reported about 27 more minutes than sophomores (67 vs 41). The other two differences are not significant once the three tests are adjusted.
Only after a rejection. Run the post hoc tests only when the ANOVA rejects. If the ANOVA fails to reject, stop there and say there is no evidence that the means differ.
If your numbers don’t match
| What you see | What went wrong |
|---|---|
| Your grand mean is 52.12 | You averaged the three means without weighting them by n. The grand mean is the mean of all 158 students |
| Your SSE is about 295,300 | You multiplied each \(s_i^2\) by \(n_i\) instead of \(n_i - 1\) |
| Residuals df is 157, and F is 6.32 | The filter isn’t active, so the two non-degree students went into upperclass. Check that its toggle is green |
| The year3 row has df 3 | The table is using class_year instead of year3 |
| F is 5.87, df2 is 92.28, and the table is titled One-Way ANOVA (Welch’s) | You chose One-Way ANOVA instead of ANOVA |
| Only a p tukey column in the post hoc table | Under Correction, check No correction and Bonferroni, and uncheck Tukey |
| Your adjusted p-values are 3 times too big | You multiplied the p bonferroni column by 3. Jamovi has already done that |
Practice on a second question
Does the number of states students have visited differ by the superpower they would choose? Use states_visited as the dependent variable and superpower as the fixed factor. It already has three levels, so it needs no recode. Keep the filter on. Two students skipped the states question, and Jamovi leaves them out, so 156 remain.
- Descriptives: ESP 40 students, mean 15.93, SD 7.41. Flying 68, mean 12.94, SD 6.63. Invisibility 48, mean 15.52, SD 7.75. Every level has at least 30, and the SD ratio is \(7.75 / 6.63 = 1.17\).
- You should get \(F = 2.87\) with 2 and 153 degrees of freedom, and \(p = 0.060\).
The p-value is above 0.05, so we fail to reject \(H_0\), and we don’t run post hoc tests. If you run them anyway, ESP vs Flying has p = 0.039 with no correction. That is the kind of result the rule protects against. Once the ANOVA fails to reject, a pair that looks different could easily be chance.