# Tests for Trends in Repeated Cross Sectional Surveys

The Cochran-Armitage trend test can be used to assess time trends in prevalence of outcomes across repeated cross-sectional surveys.

## Sample size Calculation in Stata

Statistics > Power and Sample Size > Outcome > Binary > Linear Trend in proportions in Jx2 table OR `power trend` Examples follow

Sample size for probability of 0.80, 0.85, 0.9, 0.95 across four surveys

``power trend 0.80 0.85 0.90 0.95, power(0.8) `Code language: Stata (stata)`

## What If there are just two Cross-sectional surveys ?

This situation is akin to comparing two proportions. Once cannot compare trend with just two comparison groups, minimum three are required. The sample size calculations of teh Cochran-Armitage test and two sample proportions comparison using chi-sqaured tests are going to yield same results

``````power trend 0.15  0.1
note: exposure levels are assumed to be equally spaced
Performing iteration ...
Estimated sample size for a trend test
Cochran-Armitage trend test
Ho: b = 0  versus  Ha: b != 0;  logit(p) = a + b*x
Study parameters:
alpha =    0.0500
power =    0.8000
N_g =         2
p1 =    0.1500
p2 =    0.1000
Estimated sample sizes:
N =     1,372
N per group =       686

power twoproportions 0.15  0.1, test(chi2)
Performing iteration ...
Estimated sample sizes for a two-sample proportions test
Pearson's chi-squared test
Ho: p2 = p1  versus  Ha: p2 != p1
Study parameters:
alpha =    0.0500
power =    0.8000
delta =   -0.0500  (difference)
p1 =    0.1500
p2 =    0.1000

Estimated sample sizes:

N =     1,372
N per group =       686```Code language: R (r)```

`logit(pj) = a + bxj `