Multiple Comparisons Using Tukey’s HSD Test

  Tukey’s HSD (Honestly Significant Difference) test is one of the most widely used post-hoc procedures when the goal is to determine whether there are statistically distinct group(s) within a sample, based on pairwise comparisons. As with other post-hoc tests, Tukey’s HSD is performed after conducting an ANOVA.
  It is considered a conservative test and relies on the studentized range distribution (q table). The standard Tukey–HSD test is applied when groups have equal sample sizes. For unequal group sizes, its extension—the Tukey–Kramer test—is used.

1 Equation:

\[ HSD = q_{(df,k)} \frac{qmr}{r} \]

Where:

  • df = degrees of freedom of the sample (n − k);
  • k = number of groups;
  • r = number of observations per group
  • qmr = mean square of residuals;
  • q = critical value from the studentized range distribution (q-critical).

2 Files:

  1. Tukey1matrix program, q-critical table, and 1ANAVA1matrix
  2. Program source code
  3. Table of q-critical values

3 Usage and example

# Input:
1. Enter a matrix containing the dataset;
2. Run the program "1ANAVA1matrix" from the main page ("hp50");
3. Run the program "Tukey1matrix".

# Output:
1. "qcrit5%" – value from the *q* distribution;
2. "HSD" – minimum significant difference;
3. Matrix containing comparison values for each pair of groups.


  Pairs are considered significantly different when:

\[ \Delta AB > HSD \]

(a) Insertion of data matrix.
(b) ANOVA results obtained.
(c) Results of the Tukey–HSD test.
(d) Paired comparison matrix. The group numbers A and B are shown on the left (not visible in the image).
Figure 1: Tukey1matrix program running on the Android version of the HP50G calculator (Go49gp), showing data input, ANOVA, test results, and the pairwise comparison table. The table (matrix) contains columns A, B, \(\Delta AB\), and \(\Delta HSD\).


  The results are identical to those reported in the reference source (Vieira, 2000).

4 References:

  1. Vieira, Sônia. Analysis of Variance: ANOVA. Atlas Publishing, 2000.
Back to top