Login
📚 Mostly Harmless Statistics
Chapters ▾
⇩ Download ▾

11.2 Pairwise Comparisons of Means (Post-Hoc Tests)

If you do in fact reject H0, 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 t-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 α=0.05, then the probability that an observed difference between two groups that does not occur by chance is 1α=0.95. If two comparisons are made, the probability that the observed difference is true is no longer 0.95. The probability is (1α)2=0.9025, and the P(Type I Error) = 10.9025=0.0975. Therefore, the P(Type I Error) occurs if m comparisons are made is 1(1α)m.

For instance, if we are comparing the means of four groups: There would be m=4C2=6 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) = 1(1α)6=0.2649. This is why a researcher should use ANOVA for comparing means, instead of independent t-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.

Carlo Bonferroni portrait photograph.
Carlo Bonferroni

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 t=x¯ix¯j(MSW(1ni+1nj)).

where x¯i and x¯j are the means of the samples being compared, ni and nj are the sample sizes, and MSW 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 dfW=Nk, using an adjusted αm two-tail area under the t-distribution, where k = number of groups and m=kC2, all the combinations of pairs out of k groups.

Critical Value Method

P-Value Method

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.