Ask Mallard
Analysis method

Test for linear trend

4 min read

The Cochran–Armitage test uses ordered group scores to test for a linear trend component in independent binary outcome proportions.

Fit

When to use it, and when not to

Use it when

  • You have independent binary outcomes across ordered groups and a prespecified scoring rule.
  • You want an unadjusted test of a trend component rather than all possible group differences.

Not when

Before you start

What you need

Decide these first
  1. Events and totals in each ordered groupKeep event counts separate from denominators and verify independent observations.
  2. A numeric score chosen before inspecting outcomesScores may be dose values or justified category summaries. Equal ranks need not represent equal dose gaps.
  3. A one-sided or two-sided hypothesisChoose the direction in advance; the example uses a two-sided test with no continuity correction.
It rests on these
  1. Participants contribute independent binary outcomes.How to check: Repeated visits and cluster samples need methods that account for dependence.
  2. Group scores encode the trend you intend to test.How to check: Check ordering, spacing and sensitivity to reasonable prespecified alternatives.
  3. The large-sample null approximation is adequate.How to check: Sparse data may require an exact version of the scored trend test.
  4. Missing outcome status is handled under an explicit assumption.How to check: A complete-case analysis needs justification. Consider imputation under missing at random and sensitivity to departures.

Plain language

How it works

Assign a numeric score to each group before examining outcomes. Pool the event count to estimate the event probability under the null of equal proportions. Weight each group’s excess events by its score, then divide the sum by its null standard error. Squaring this score gives an approximate chi-square statistic with one degree of freedom for a two-sided test.

Reading the result

The uncorrected variance uses the pooled event probability and the weighted spread of group scores. The test targets a trend component, so it can miss important curved differences. Nam studies its sample-size and power behavior; Leuraud and Benichou investigate trend-test behavior under nonmonotone alternatives. The test produces a p-value, not an estimated clinical effect or a confidence interval for a dose-response slope.

The method in steps
The score test detects a trend component. It does not estimate a slope or certify the shape of the response.Test for linear trendPrespecify numeric scores for ordered groupsCount binary events and denominatorsCompare scored events with the pooled nullUse a two-sided score testReport risks and the trend p-valueThe score test detects a trend component. It does not estimate a slope or certify the shape of theresponse.
Conceptual diagram. It shows the structure of the idea, not data from any study.

Worked example

A worked example

Invented for illustration
Setting
Three ordered exposure groups each contain 100 people, with 10, 20 and 30 events.
Question
Is there a trend component across prespecified scores 0, 1 and 2?
Approach
Use the two-sided Cochran–Armitage score test without a continuity correction.
Result
Event proportions are 10, 20 and 30 in 100. The squared score statistic is 12.50, with 1 degree of freedom; p = 0.000407.
What it means
The test finds evidence of a trend component for those scores. It supplies no effect-size confidence interval and does not establish a linear curve.

In practice

Recent studies PubMed search · not vetted

Searching PubMed…

Watch out

Common mistakes

The one to remember

A trend p-value depends on the assigned scores. It does not prove a straight dose-response curve, monotonicity, causation or a clinically important effect.

  • Picking the scores that give the smallest p-value.Instead: Prespecify scores and label later score searches as exploratory.
  • Equating a small p-value with a straight or monotone curve.Instead: Plot group risks and assess departures from the trend shape.
  • Reporting the score statistic as the size of the effect.Instead: Report group risks. If estimating a regression slope, give its model-specific Wald or profile interval and state the scale.

Inside Mallard

How Mallard uses this

The method registry links this method to its published analysis article and code.

Code example in Mallard: Cochran-Armitage test for trend in a proportion (cochran-armitage-trend).
Atlas node analysis.linear_trend, the id a plan cue records.
Code for this method
Loading…

Related Learn pages

Related designs and methods

Evidence

Sources & further reading

  1. A simple approximation for calculating sample sizes for detecting linear trend in proportions (opens in a new tab) · Biometrics
  2. A comparison of stratified and adjusted trend tests for binomial proportions (opens in a new tab) · Stat Med · doi 10.1002/sim.2239
  3. Avoiding power loss associated with categorization and ordinal scores in dose-response and trend analysis (opens in a new tab) · Epidemiology · doi 10.1097/00001648-199507000-00025
PubMed records, authors, years and available DOIs checked 2026-11-06. Nam gives original methods for the Cochran–Armitage test and its power; PubMed lists no DOI. Leuraud and Benichou provide original simulations showing why a significant trend component need not establish monotonicity. Greenland supports caution about category scores. No independent professional approval is claimed.
Last source review: 2026-11-06
AI-generated educational content
Mallard uses reputable methodological and reporting sources, but this material may contain errors or omit important context. Verify important methodological decisions with the cited sources and, when appropriate, a qualified research methodologist or statistician.