The Cochran–Armitage test for trend, named for William Cochran and Peter Armitage, is used in categorical data analysis when the aim is to assess for the presence of an association between a variable with two categories and a variable with k categories. It modifies the Pearson chi-squared test to incorporate a suspected ordering in the effects of the k categories of the second variable. For example, doses of a treatment can be ordered as 'low', 'medium', and 'high', and we may suspect that the treatment benefit cannot become smaller as the dose increases. The trend test is often used as a genotype-based test for case-control genetic association studies.
The trend test is applied when the data take the form of a 2 × k contingency table. For example, if k = 3 we have
This table can be completed with the marginal totals of the two variables
where R1 = N11 + N12 + N13, and C1 = N11 + N21, etc.
The trend test statistic is
where the ti are weights, and the difference N1iR2 −N2iR1 can be seen as the difference between N1i and N2i after reweighting the rows to have the same total.
The hypothesis of no association (the null hypothesis) can be expressed as:
Assuming this holds, then, using iterated expectation,
The variance can be computed by decomposition, yielding
and as a large sample approximation,
The weights ti can be chosen such that the trend test becomes locally most powerful for detecting particular types of associations. For example, if k = 3 and we suspect that B = 1 and B = 2 have similar frequencies (within each row), but that B = 3 has a different frequency, then the weights t = (1,1,0) should be used. If we suspect a linear trend in the frequencies, then the weights t = (0,1,2) should be used. These weights are also often used when the frequencies are suspected to change monotonically with B, even if the trend is not necessarily linear.