Proportions: Many Groups
Calculate the required equal sample size per group for detecting a linear trend in proportions using the Cochran-Armitage test. The calculation follows the asymptotic sample-size method of Nam (1987), the method documented in the statistical literature for this procedure.
The Cochran-Armitage test evaluates whether proportions exhibit a monotone linear trend across ordered groups. This method uses its power and sample-size procedure as being based on the method of Nam (1987), which assumes that the response probability follows a linear trend on the logistic scale:
Under the null hypothesis, all group proportions are equal. The alternative specifies an increasing or decreasing trend across the ordered X values. For a two-sided test, either direction of trend can produce rejection.
Let n be the common sample size per group, let pi be the anticipated response proportion in group i, and let xi be its ordered score. With equal group sizes, the weighted mean X value and the pooled anticipated proportion are
The calculator then evaluates the asymptotic power equation described by Nam and. For an increasing trend, the continuity-corrected upper-tail calculation uses the correction Δ/2; for a decreasing trend the corresponding lower-tail calculation is used. For a two-sided test, the upper and lower tail probabilities are combined.
For an increasing one-sided test, power is 1 − Φ(uU). For a decreasing one-sided test, the analogous lower-tail expression is used. For a two-sided test, power is 1 − Φ(uU) + Φ(uL). When the uncorrected test is selected, Δ is set to zero.
For equally spaced X values, Δ is the common distance between adjacent X values. For unequally spaced X values, this method defines Δ as the average adjacent spacing. this method also cautions that a constant continuity correction is not adequate for all outcomes when the covariates are unequally spaced. Accordingly, the uncorrected statistic is generally preferable when unequal spacing is used.
The calculator searches over integer values of the common group sample size n and returns the first value for which the calculated asymptotic power is at least the requested target. Total sample size is k × n.
the relevant methodological literature gives a direct sample-size example with three equally spaced groups, anticipated proportions of 0.05, 0.15, and 0.25, a two-sided alpha of 0.05, and a continuity-corrected Z test. For target power of 0.95, This yields 85 subjects per group, or 255 subjects total, with achieved power 0.95054.
This calculator reproduces that validation result using the same asymptotic power equation: at n = 85 per group, the calculated power is approximately 0.9505445.
Nam, J. (1987). A Simple Approximation for Calculating Sample Sizes for Detecting Linear Trend in Proportions. Biometrics, 43(3), 701–705. DOI: 10.2307/2532006.
the software, LLC. this method Sample Size Software: Cochran-Armitage Test for Trend in Proportions, Chapter 255. the relevant methodological literature describes the asymptotic and exact power calculations and identifies Nam (1987) as the basis of the procedure.