# Cochran-Armitage trend test

The Cochran-Armitage trend test allows to check if a series of proportions vary linearly along a numeric variable. Do it in Excel using the XLSTAT software.

## When to use a Cochran-Armitage trend test

The Cochran Armitage trend is used to test if a series of proportions, possibly computed from a contingency table, can be considered as varying linearly with an ordinal or continuous variable.

It can be a one- or two-sided test.

## What is the Cochran-Armitage trend test

The **Cochran-Armitage test **allows to test if a series of proportions, can be considered as varying linearly with an ordinal or continuous score variable.

If X is the score variable, the statistic that is computed to test for the linearity is given by:

z = [Ʃ_{i=1..r} n_{r1}(X_{i} - X)] / √ p_{+1} (1– p_{+1}) s²

with s²=Ʃ_{i=1..r} n_{i+}(X_{i} - X)²

*Note: if X is an ordinal variable, the minimum value of X has no influence on the value of z.*

In the case of the two-tailed (or two-sided) test, the null (H_{0}) and alternative (H_{a}) hypotheses are:

- H
_{0}: z = 0 - H
_{a}: z ≠ 0

*Note: z is asymptotically distributed as a standard Normal variable. Some statistical programs use z² to test the linearity. z² follows a Chi-square distribution with one degree of freedom.*

In the one-tailed case, you need to distinguish the left-tailed (or lower-tailed or lower one-sided) test and the right-tailed (or upper-tailed or upper one-sided) test. In the left-tailed test, the following hypotheses are used:

- H
_{0}: z = 0 - H
_{a}: z < 0

If H_{a} is chosen, one concludes that the proportions decrease when the score variable increases.

In the right-tailed test, the following hypotheses are used:

- H
_{0}: z = 0 - H
_{a}: z > 0

If H_{a} is chosen, one concludes that the proportions increase when the score variable increases.