Chip Foundry Services Request Assessment

Tukey Hsd

Tukey HSD (honestly significant difference) is the standard follow-up when a one-way ANOVA says that some group means differ but not which ones. It compares every pair of groups at once and widens each interval just enough that the chance of any false alarm across the whole family stays at the chosen level, usually 5%.

The procedure, from overall test to a list of differing pairs:

ANOVA says some group means differ
the overall F-test cannot say which ones
Tukey HSD for every pairone critical value covers the whole family
Compute each mean difference
A vs B, A vs C, B vs C
Find the standard error
from the ANOVA error mean square
Compare with the studentized range
q for k groups and error df
Interval excludes 0
that pair differs, with family-wise error held at 5%
Interval includes 0
no reliable difference for that pair

Why not just run many t-tests? With $k$ groups there are $m=k(k-1)/2$ pairs. Each unadjusted test has a 5% false-positive rate, so the chance of at least one false alarm grows quickly. If the tests behaved independently, three comparisons would give about $1-0.95^3\approx0.143$ (14.3%), and the 15 pairs among six groups would give about $1-0.95^{15}\approx0.537$. Tukey replaces that growth with a single family-wise error rate.

The formula. For groups $i$ and $j$ with sizes $n_i,n_j$, the ANOVA error mean square $MS_W$ on $\nu=N-k$ degrees of freedom gives the Tukey-Kramer simultaneous interval, which also handles unequal group sizes:

$$\bar{y}_i-\bar{y}_j\ \pm\ \frac{q_{1-\alpha,\,k,\,\nu}}{\sqrt{2}}\sqrt{MS_W\left(\frac{1}{n_i}+\frac{1}{n_j}\right)}$$

Here $q_{1-\alpha,k,\nu}$ is the upper critical value of the studentized range distribution, the distribution of the largest minus the smallest of $k$ means divided by the standard error. For equal group size $n$ the half-width is the single number $\mathrm{HSD}=q\sqrt{MS_W/n}$; any pair of means farther apart than HSD is declared different.

Worked example. The three etch-recipe groups from the ANOVA entries have sizes $3,4,5$, means $13,\,16.5,\,21$, $MS_W=17/9\approx1.889$, and $\nu=9$. The $95\%$ studentized-range value is $q_{0.95,3,9}\approx3.948$.

PairDifferenceTukey half-width95% intervalAdjusted p
B minus A$3.5$$2.931$$[0.57,\,6.43]$$0.0215$
C minus A$8.0$$2.802$$[5.20,\,10.80]$$0.0001$
C minus B$4.5$$2.574$$[1.93,\,7.07]$$0.0022$

Every interval excludes $0$, so all three recipes differ from each other while the family-wise error stays at 5%. The intervals match both scipy and statsmodels. The picture compares them with the narrower unadjusted $t$ intervals, which would look more precise but overstate the evidence:

Tukey keeps all the comparisons honest 95% intervals for the three recipe differences; unadjusted intervals are narrower but too optimistic 0 = no difference 2 4 6 8 10 12 difference in mean critical-dimension shift (nm) B minus A adjusted p = 0.0215 3.5 [0.57, 6.43] C minus A adjusted p = 0.0001 8 [5.20, 10.80] C minus B adjusted p = 0.0022 4.5 [1.93, 7.07] Tukey (family of 3) unadjusted

Practical rules.

  • Adjusted p-values: report the Tukey-adjusted p-value or simultaneous interval, not the raw t-test p-value for each pair.
  • Assumptions: independent observations, roughly normal residuals, and similar variances across groups. If variances differ clearly, use the Games-Howell procedure instead.
  • Unequal sizes: the Tukey-Kramer form above is the right one; do not average the group sizes by hand.
  • Alternatives: Bonferroni is simpler but, when every pair is compared, is often more conservative. Here its B minus A half-width would be about $3.08$ against Tukey's $2.93$. Dunnett's test is better when every group is compared only to a control.
  • Meaning: a difference being reliably non-zero does not mean it is large enough to matter; read the interval in process units.

Read Tukey HSD as an ANOVA follow-up that answers "which pairs differ?" with one shared error budget: wider intervals than separate t-tests, in exchange for a false-alarm rate you can actually state.