11.2 Pairwise Comparisons of Means (Post-Hoc Tests)
If you do in fact reject , then you know that at least two of the means are different. The ANOVA test does not tell which of those means are different, only that a difference exists. Most likely your sample means will be different from each other, but how different do they need to be for there to be a statistically significant difference?
To determine which means are significantly different, you need to conduct further tests. These post-hoc tests include the range test, multiple comparison tests, Duncan test, Student-Newman-Keuls test, Tukey test, Scheffé test, Dunnett test, Fisher’s least significant different test, and the Bonferroni test, to name a few. There are more options, and there is no consensus on which test to use. These tests are available in statistical software packages such as R, Minitab and SPSS.
One should never use two-sample -tests from the previous chapter. This would inflate the type I error.
The probability of at least one type I error increases exponentially with the number of groups you are comparing. Let us assume that , then the probability that an observed difference between two groups that does not occur by chance is . If two comparisons are made, the probability that the observed difference is true is no longer 0.95. The probability is , and the P(Type I Error) = . Therefore, the P(Type I Error) occurs if comparisons are made is .
For instance, if we are comparing the means of four groups: There would be different ways to compare the 4 groups: groups (1,2), (1,3), (1,4), (2,3), (2,4), and (3,4). The P(Type I Error) = . This is why a researcher should use ANOVA for comparing means, instead of independent -tests.
There are many different methods to use. Many require special tables or software. We could actually just start with post-hoc tests, but they are a lot of work. If we run an ANOVA and we fail to reject the null hypothesis, then there is no need for further testing and it will save time if you were doing these steps by hand. Most statistical software packages give you the ANOVA table followed by the pairwise comparisons with just a change in the options menu. Keep in mind that Excel is not a statistical software and does not give pairwise comparisons.
We will use the Bonferroni Test, named after the mathematician Carlo Bonferroni. The Bonferroni Test uses the t-distribution table and is similar to previous t-tests that we have used, but adjusts to the number of comparisons being made.

The Bonferroni test is a statistical test for testing the difference between two population means (only done after an ANOVA test shows not all means are equal).
The formula for the Bonferroni test statistic is .
where and are the means of the samples being compared, and are the sample sizes, and is the within-group variance from the ANOVA table.
The Bonferroni test critical value or p-value is found by using the t-distribution with within degrees of freedom , using an adjusted two-tail area under the t-distribution, where = number of groups and , all the combinations of pairs out of groups.
Critical Value Method
P-Value Method
Example 2
A research organization tested microwave ovens. At = 0.10, is there a significant difference in the average prices of the three types of oven?

Show solution
The ANOVA was run in Excel.

To test if there is a significant difference in the average prices of the three types of oven, the hypotheses are:
At least one mean differs.
Use the Excel output to find the p-value in the ANOVA table of 0.001019, which is less than so reject ; there is at least one mean that is different in the average oven prices.
There is a statistically significant difference in the average prices of the three types of oven. Use the Bonferroni test p-value method to see where the differences are.
Compare and :
To find the p-value, find the area in both tails and multiply this area by . The area to the right of , using , is 0.0520563. Remember these are always two-tail tests, so multiply this area by 2, to get both tail areas of 0.104113.
Try it in XYZ Crunch
Reproduce the three Bonferroni p-values
Each link opens the t-distribution with df = 19 showing the right-tail area beyond one pairwise test statistic. Do the last steps yourself: double the tail area, then multiply by m = 3 comparisons (cap at 1). The first gives 0.0520563 x 2 x 3 = 0.3123, matching the SPSS Sig. column in Figure 11-4.

Then multiply this area by to get a p-value = 0.3123.

Since the p-value = , we do not reject . There is a statistically significant difference in the average price of the 1,000- and 900-watt ovens.
Compare and :
Use = 19 to find the p-value.

Since the p-value = (tail areas)*3 = , we reject . There is a statistically significant difference in the average price of the 1,000- and 800-watt ovens.
Compare and :
Use to find the p-value (remember that these are always two-tail tests).

Since the p-value = , we reject . There is a statistically significant difference in the average price of the 900- and 800-watt ovens.
There is a chance that after we multiply the area by the number of comparisons, the p-value would be greater than one. However, since the p-value is a probability we would cap the probability at one.
This is a lot of math! The calculators and Excel do not have post-hoc pairwise comparisons shortcuts, but we can use the statistical software called SPSS to get the following results. We will look specifically at interpreting the SPSS output for Example 11-4.


The first table, labeled "Descriptives", gives descriptive statistics; the second table is the ANOVA table, and note that the p-value is in the column labeled Sig. The Multiple Comparisons table is where we want to look. There are repetitive pairs in the last table, just in a different order.
The first two rows in Figure 11-4 are comparing group 1 with groups 2 and 3. If we follow the first row across under the Sig. column, this gives the p-value = 0.312 for comparing the 1,000- and 900-watt ovens.

The second row in Figure 11-4 compares the 1,000- and 800-watt ovens, p-value = 0.001.

The third row in Figure 11-4 compares the 900- and 1000-watt ovens in the reverse order as the first row; note that the difference in the means is negative but the p-value is the same.

The fourth row in Figure 11-4 compares the 900- and 800-watt ovens, p-value = 0.028.

The last set of rows in Figure 11-4 are again repetitive and give the 800-watt oven compared to the 900- and 1000-watt ovens.
Keep in mind that post-hoc is defined as occurring after an event. A post-hoc test is done after an ANOVA test shows that there is a statistically significant difference. You should get at least one group that has a result of "reject ", since you only do the Bonferroni test if you reject for the ANOVA.
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.