Test for linear trend
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
- You need confounder adjustment or clustered inference. Use an appropriate logistic model and variance method. Read: Logistic regression
- A nonlinear dose-response shape is central to the question. Consider restricted cubic splines. Read: Restricted cubic splines
- Your categories have no meaningful order. Use a chi-square test of independence. Read: Choosing a test for a table of counts
Before you start
What you need
- Events and totals in each ordered groupKeep event counts separate from denominators and verify independent observations.
- A numeric score chosen before inspecting outcomesScores may be dose values or justified category summaries. Equal ranks need not represent equal dose gaps.
- A one-sided or two-sided hypothesisChoose the direction in advance; the example uses a two-sided test with no continuity correction.
- Participants contribute independent binary outcomes.How to check: Repeated visits and cluster samples need methods that account for dependence.
- Group scores encode the trend you intend to test.How to check: Check ordering, spacing and sensitivity to reasonable prespecified alternatives.
- The large-sample null approximation is adequate.How to check: Sparse data may require an exact version of the scored trend test.
- 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.
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.
Worked example
A worked example
- 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
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.
cochran-armitage-trend).analysis.linear_trend, the id a plan cue records.Related Learn pages
Related designs and methods
Evidence
Sources & further reading
- A simple approximation for calculating sample sizes for detecting linear trend in proportions (opens in a new tab) · Biometrics
- A comparison of stratified and adjusted trend tests for binomial proportions (opens in a new tab) · Stat Med · doi 10.1002/sim.2239
- 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