Biology, images, analysis, design...
Use/Abuse Principles How To Related
"It has long been an axiom of mine that the little things are infinitely the most important" (Sherlock Holmes)

Search this site




Chi square test for trend

This is also known as the Cochran-Armitage test for trend. The test is appropriate for testing association between a nominal variable with two levels (say infected and uninfected) and an ordinal variable (say low dose, medium dose high dose).

If one applies the usual Pearson chi squared test for independence, it will not take account of any trend of infection level (p=infected/total) with dosage. The chi squared test for trend test for a linear trend against the null hypothesis of no trend.

In effect this is equivalent to a linear regression (see Unit 12) of proportion infected against score, weighted according to the number of individuals with each score.

The simplest way to apply this test requires you express the data as frequencies:

Score xStatusTotal =n
Infected =cUninfected =d
low (1)52530
medium (2)141630
high (3)181230
totals37 =C43 =D90 =N

Algebraically speaking -

X2(L) = {T1 − (CT2/N)}2/V


  • T1 = Σ(cx)
  • T2 = Σ(nx)
  • T3 = Σ(nx2)

    These are summed for all rows.

  • V = CD(NT3 − T22)/(N2(N − 1))

X2(L) is tested against chi-square with 1 degree of freedom.

For these data X2(L) was 11.51, which gave a P-value of 0.0007