Planned Contrasts and Post Hoc Comparisons: Why the Timing of the Decision Changes the Inference

A one-way ANOVA answers one question: is there any difference among the group means at all? It almost never answers the question you actually care about, which is which groups differ and by how much.


Getting from the omnibus test to a specific comparison is where most of the inferential risk lives, and the single most important thing about a comparison is when it was decided on.

The distinction, stated precisely

  • A planned (a priori) comparison is specified before the data are examined. It comes from the research question, the design, or a protocol written in advance. There are usually few of them, and they are chosen without any knowledge of which groups happened to come out high or low.
  • An unplanned (post hoc, a posteriori) comparison is chosen after looking at the results. The commonest case is testing all pairs of groups; the most dangerous case is testing the one pair that looked most striking.


The arithmetic of the two comparisons can be identical. What differs is the reference distribution that the test statistic should be judged against, and therefore the p-value that the number deserves.

Why selection changes the reference distribution

Suppose all the population means are genuinely equal. A single prespecified difference then behaves like a draw from a distribution centred on zero, and a 5% test rejects 5% of the time. That is what a nominal p-value assumes.


Now suppose you look at the data first and test the largest observed difference.


You are no longer sampling one difference; you are sampling the maximum of several, and the maximum of several draws is systematically larger than a typical draw even when nothing real is going on.


Judging it against the distribution for a single comparison therefore rejects far more often than 5% of the time. The comparison did not become more powerful; the yardstick became too short.


This is why post hoc procedures use wider critical values than an unadjusted test. They are not being conservative for its own sake: they are referencing the correct distribution for a statistic that was selected for being extreme.

Multiplicity, quantified

Even without cherry-picking, running many tests inflates the chance of at least one false positive. If mm tests are independent and each uses level α\alpha, then the probability of at least one type I error when every null hypothesis is true is


FWER=1−(1−α)m.\mathrm{FWER} = 1 - (1-\alpha)^m.


With three groups there are (32)=3\binom{3}{2} = 3 pairwise comparisons, so at α=0.05\alpha = 0.05,


1−(0.95)3=1−0.857375=0.1426,1 - (0.95)^3 = 1 - 0.857375 = 0.1426,


roughly a 14% chance of at least one spurious "significant" pair if those tests were independent.


State the assumption honestly, though: pairwise comparisons among group means are not independent, because each mean appears in several of them.


The formula is a useful order-of-magnitude guide for how fast the problem grows, not an exact familywise error rate for a set of pairwise tests. Procedures designed for that specific family handle the dependence properly.

Contrasts: how a planned comparison is written

A contrast is a weighted combination of the group means,


L=∑iciμi,with∑ici=0.L = \sum_i c_i \mu_i, \qquad \text{with} \qquad \sum_i c_i = 0.


The sum-to-zero condition is what makes LL a comparison rather than a rescaled average: it is zero whenever all the means are equal, whatever their common value. Two rules generate the coefficients you need.


  • Groups on opposite sides of the comparison get opposite signs; groups not involved get zero.
  • The two sides carry equal total weight, which is what makes the coefficients sum to zero. When the comparison is between the unweighted averages of the groups on each side, each side's total weight is also divided equally among its groups. Other prespecified contrasts may use unequal weights within a side, for example to encode a planned trend, but the coefficients must still express the intended hypothesis and sum to zero.


For three groups, placebo, low dose, high dose, a contrast for a dose trend is (−1, 0, +1)(-1,\,0,\,+1): it ignores the middle group by design and asks whether the high-dose mean exceeds the placebo mean.


It sums to zero, so it is a legitimate contrast. Notice that this contrast was chosen because the doses are ordered, a fact known before any data arrived. That is what makes it planned.


Under the one-way ANOVA model with independent normal equal-variance errors, a complete set of k−1k-1 contrasts orthogonal under the design-appropriate sample-size weighting partitions the treatment sum of squares into independent one-degree-of-freedom components.


With unequal group sizes, ordinary coefficient dot products do not in general establish this orthogonality. Fewer contrasts account for only part of the treatment sum of squares.

Choosing between the two approaches

Planned contrasts are preferable when you can write them down. They can be few and map directly onto the scientific question. A prespecified contrast can use the ordinary single-comparison reference distribution for its marginal p-value.


If several planned contrasts support a familywise claim, their multiplicity must also be considered. A planned contrast does not require a significant omnibus F test first; the F test answers a different question.


Post hoc procedures are the right tool when the study is genuinely exploratory, when no specific comparison was identified in advance, or when you want all pairwise comparisons. They cost power, and that cost is the price of an honest error rate over the whole set of comparisons that were implicitly searched.

The misconception that matters most

"Planned" is a claim about a decision made at a particular time, not a property of the arithmetic.


A comparison chosen after seeing the means and then described in the write-up as though it had been planned is a post hoc comparison reported at an unadjusted error rate.


Nothing in the computed numbers reveals the difference, which is exactly why preregistering the contrasts, or reporting plainly that a comparison was suggested by the data, carries so much weight.

A researcher compares four teaching methods with a one-way ANOVA and then examines differences between particular pairs of methods.

What distinguishes a planned comparison from an unplanned (post hoc) one?

Choose an answer

Create a free account to get started

Unlock full course notes by signing up

  • Video lessons taught by top educators
  • Practice questions with guided solutions
  • Written review notes for reference
  • Expert answers anytime from course tutors

Six treatment groups are compared. After seeing the results, an analyst identifies the group with the highest sample mean and the group with the lowest, and tests the difference between just those two.

Why does a valid test of this difference require a wider critical value than an ordinary two-sample comparison would?

Choose an answer

Create a free account to get started

Unlock full course notes by signing up

  • Video lessons taught by top educators
  • Practice questions with guided solutions
  • Written review notes for reference
  • Expert answers anytime from course tutors

A trial has four groups, listed in this order: placebo, drug A at low dose, drug A at high dose, and drug B. Before the data were collected, the investigators specified one comparison of interest: the average effect of the two drug A doses against placebo.

Which set of contrast coefficients, in the order given, expresses that planned comparison?

Choose an answer

Create a free account to get started

Unlock full course notes by signing up

  • Video lessons taught by top educators
  • Practice questions with guided solutions
  • Written review notes for reference
  • Expert answers anytime from course tutors