Lawfare Group → Knowledge Institute → Lawfare Academy

← Course syllabus · Related lesson

Ask which comparison before inspecting the means

Current complete on-site edition 5

Required teaching and complete optional models are supplied on LawfareGroup.com. Publisher and primary links are optional provenance or further reading. Florida is the contemporary state-law default; federal rules and explicitly comparative accounting frameworks are distinguished. Independent subject review and observed human learner testing remain pending.

Cumulative statistical study dossier, transfer models and 30-point rubric

Preserved original teaching integrated with complete current on-site preparation. Independent human subject review and observed learner testing remain pending.

Learning objectives

The business question determines the comparison

A service firm compares three processing protocols, A, B and C. The response is a quality score on the same scale for every observation. Suppose the observations are A=[8,9,10], B=[10,11,12] and C=[12,13,14]. Their means are 9,11 and 13, with a grand mean of 11. Before analyzing these scores, distinguish the question 'Are all three population means equal?' from the question 'How much does C differ from A?' An omnibus test addresses the first; a contrast can address the second.

These nine numbers are a synthetic arithmetic fixture. A real analysis must state how protocols were assigned, what counts as an independent experimental unit, whether measurements share staff or sessions, and what population the conclusion targets. If each protocol was used on a different day, protocol and day are confounded. Replicating readings from the same job does not create independently assigned jobs. An analysis-of-variance table cannot recover an assignment design that the study never had.

The conventional one-factor model used here assumes independent errors, a common within-group variance and a normal error distribution for its exact small-sample reference tests. Its fitted group means can be calculated without normality, but the inferential reference distribution needs its assumptions. Examine the design and residual evidence rather than treating the word 'ANOVA' as an automatic approval of a comparison.

Separate the two sources of squared variation

The between-group sum of squares is Σng(mean_g−grand mean)². Here it is 3(9−11)²+3(11−11)²+3(13−11)²=24. The within-group sum of squares is the sum of squared deviations from each group’s own mean: 2+2+2=6. Total variation about the grand mean is 30, and the identity 30=24+6 is an arithmetic check. Use clear labels because textbooks differ in whether SST names total or treatment variation.

There are k−1=2 between-group degrees of freedom and N−k=6 within-group degrees of freedom. Their mean squares are 24/2=12 and 6/6=1. The F ratio is 12. Under the equal-means null and the stated normal, independent, common-variance model, it is compared with an F distribution on (2,6) degrees of freedom. A large ratio means the observed separation of group means is large relative to the estimated within-group variation. It does not identify a mechanism or establish every pairwise difference.

A rank ordering of sample means is descriptive even when the inferential evidence is weak. Conversely, an omnibus rejection does not mean that every adjacent pair differs. Report estimates and uncertainty for the actual questions instead of converting a single global result into unsupported claims about all comparisons. If variability differs substantially between protocols, a common pooled within-group variance may be inappropriate; consider a justified alternative and its target rather than changing methods only until one produces a desired result.

A planned contrast has its own estimate and uncertainty

Suppose the predeclared primary comparison is C−A. Its contrast weights are [−1,0,1], which sum to zero, and its estimate is 13−9=4. With pooled within-group variance estimate MSE=1, the estimated variance is MSE×Σcg²/ng=1×(1/3+1/3)=2/3. The standard error is about .816497. Using t_.975,6≈2.446912 gives a pointwise 95% interval 4±1.9979, approximately [2.0021,5.9979]. The t statistic for a zero contrast is about 4.898979.

This is a pointwise interval for one specified contrast under the common-variance model, not a simultaneous 95% guarantee for every pair that might be examined. If investigators select the largest observed gap after looking at all groups, their selection must be part of the inferential procedure. Prespecifying one primary contrast can clarify the question, but does not license hiding a larger family of analyses. State secondary and exploratory comparisons and use an appropriate family procedure when simultaneous claims are intended.

Practical importance also needs a scale. If a four-point estimated improvement has a three-point minimum-benefit requirement, the interval includes benefits below three. Evidence against a zero contrast does not establish a benefit above that threshold. If the groups were not randomized or otherwise exchangeable for the intended causal question, a nonzero contrast is still an association. Preserve the design, estimand, analysis plan, all group outcomes and the operational threshold in the report; the numerical table is only one part of that argument.

Worked example: A contrast with a different substantive meaning

The comparison C−(A+B)/2 uses weights [−.5,−.5,1] and estimates 13−10=3. Its estimated variance is (.25+.25+1)/3=.5 and its standard error is sqrt(.5)≈.707107. This compares C with an equally weighted average of protocol means; it is not automatically a job-weighted average when group sizes differ. The target must be named before weights are chosen.

Worked example: A scale change leaves the test ratio unchanged

Multiply every quality score by ten. Both between and within sums of squares multiply by 100, so their ratio F remains 12. The C−A estimate and its standard error both multiply by ten, leaving the zero-contrast t statistic unchanged. Practical thresholds and reporting units must change consistently. Statistical invariance does not make the substantive score scale irrelevant.

Progressive optional practice

Attempt each problem before opening its model. Then revise the reasoning under the changed conditions.

Guided

Reproduce the sums of squares, degrees of freedom, mean squares and F ratio.

Compare the model reasoning

Between SS=24, within SS=6, total SS=30; degrees of freedom are 2,6,8. Mean squares are 12 and 1, giving F=12.

Changed conditions

All scores are multiplied by ten.

Compare the revised analysis

SS values become 2400,600,3000; the mean squares scale together and F stays 12.

Independent

Estimate C−A with its pooled-model standard error and interval. Does it establish a benefit above three?

Compare the model reasoning

Estimate=4, SE=sqrt(2/3)≈.816497. The stated pointwise interval is about [2.0021,5.9979], so it includes benefits below three.

Changed conditions

Protocol C has markedly larger within-group variability.

Compare the revised analysis

The pooled common-variance premise needs investigation. Do not carry over this standard error and coverage claim without a justified variance model or alternative design-based analysis.

Transfer

The analyst reports only the largest observed pairwise gap as though it were a prespecified comparison. Write the correction.

Compare the model reasoning

Disclose the complete comparison family and outcome-selection process. Retain all group estimates; distinguish primary planned analyses from selected exploratory results and use an appropriate simultaneous or selection-aware procedure for the intended claim.

Changed conditions

Every protocol was used on a different day.

Compare the revised analysis

Protocol and day are inseparable in that design. A multiplicity adjustment cannot identify the protocol effect; redesign or limit the causal claim.

Source readings and scope

NIST: one-way ANOVA — Background for the one-factor decomposition. Scores, interpretation and exercises are original.

NIST: estimates and confidence intervals for contrasts — Reference for contrast uncertainty under the stated model. This lesson makes a single pointwise interval claim, not a simultaneous family guarantee.

Reproduce the worked examples in Python 3. Standard library only; synthetic data; no production records or network access.