Suppose binary response Y with values "Pos" or "Neg" indicates positive or negative response, and continuous variable DOSE is the amount of a drug. You can test that the proportion of positive response increases (or decreases) with dose using the Cochran-Armitage test in the FREQ, MULTTEST, or LOGISTIC procedure.
In PROC FREQ, use the TREND option in the TABLES statement to request the asymptotic Cochran-Armitage test of trend. One- and two-sided p-values are provided. For small or sparse samples, you can request an exact version of the test by adding the exact trend; statement. If the data set is too small or sparse to use the asymptotic test, but too large for the exact algorithm, you can request Monte-Carlo estimation of the exact p-value by adding the MC option in the exact trend; statement.
For an example, see "Cochran-Armitage Trend Test" in the Examples section of the FREQ procedure documentation.
In PROC MULTTEST, you can request the Cochran-Armitage test by specifying CA(variable) in the TEST statement, where variable is the response variable. The response variable must be numeric with values 0 and 1, where 1 is the response level indicating the event of interest and 0 indicates the nonevent level. A two-tailed test is provided by default, but an upper- or lower-tailed test can be requested by specifing UPPERTAILED or LOWERTAILED following the response variable and a slash. An exact test can be requested by specifying PERMUTATION=number after the response variable and a slash, where number is the total number of observed events.
For example, if variable Y above is recoded numerically with value 1 indicating positive response and value 0 indicating negative response, then the following provides the Cochran-Armitage test.
proc multtest; class dose; test ca(y); run;
An advantage to using the MULTTEST procedure rather than the FREQ or LOGISTIC procedure is when you are conducting multiple simultaneous tests, such as if you have multiple binary conditions for which you want to conduct trend tests. In these situations, you can specify one or more adjustment methods in the PROC MULTTEST statement. MULTTEST offers a wide array of modern p-value adjustments for the problem of multiple testing. See the example titled "Cochran-Armitage Test with Permutation Resampling" in the MULTTEST documentation.
In PROC LOGISTIC, the score test in the Testing Global Null Hypothesis: BETA=0 table is equivalent to the Cochran-Armitage trend test on the event probability. Specify the EVENT= response option to indicate the event level. Note that the score test uses a chi-square statistic which is the square of the Z statistic used in PROC FREQ, but the p-values are the same.
proc logistic; model y(event="Pos") = dose; run;