The FREQ Procedure

# Example 7: Computing the Cochran-Armitage Trend Test

Procedure features:
EXACT statement options:
 statistic-keywords MAXTIME=
TABLES statement options:
 CL MEASURES TREND
TEST statement
WEIGHT statement

This example

• creates a two-way table using existing cell counts

• computes measures of association and asymptotic 95% confidence limits

• computes asymptotic and exact p-values for the Cochran-Armitage trend test

• specifies the maximum time to compute an exact p-value

• computes asymptotic tests for Somers' D(C|R).

The Cochran-Armitage test checks for trend in binomial proportions across levels of a single factor. Use this test for a contingency table with a two-level response variable and an explanatory variable with any number of ordered levels. The binomial proportion is defined as the proportion in the first level of the response variable. PROC FREQ uses explanatory variable scores to compute the Cochran-Armitage test, which you can set to meaningful values that reflect the degree of difference among the levels.

 ```options nodate pageno=1 linesize=80 pagesize=72; data pain; input Dose Adverse \$ Count @@; cards; 0 No 26 0 Yes 6 1 No 26 1 Yes 7 2 No 23 2 Yes 9 3 No 18 3 Yes 14 4 No 9 4 Yes 23 ;```
 ```proc freq data=pain; weight count;```
 ` tables dose*adverse /trend measures cl;`
 ` test smdcr;`
 ` exact trend /maxtime=60;`
 ``` title1 'Clinical Trial for Treatment of Pain'; run;```

 The Row Pct values show the expected increasing trend in the proportion of adverse effects (from 18.75% to 71.88%). Somers' D (C|R ) measures the association. The column variable (Adverse) is the response and the row variable (Dose) is a predictor. Because the asymptotic 95% confidence limit does not contain zero, this indicates a strong positive association. Similarly, Pearson and Spearman correlation coefficients show evidence of a strong positive association as hypothesized. The Cochran-Armitage test supports the trend hypothesis. The small left-sided p-values indicate that the probability of the Column 1 level (Adverse=No) decreases as Dose increases, or equivalently, that the probability of the Column 2 level (Adverse=Yes) increases as Dose increases. The two-sided p-value tests against either the increasing or the decreasing alternative. This is an appropriate hypothesis when you want to determine whether the drug has progressive effects on the probability of adverse effects, but the direction is unknown.