The CMH option in the TABLES statement of PROC FREQ is often used to obtain a test of the association between the row and column variables adjusted for the strata. Only asymptotic CMH tests, requiring large overall sample size, are available in PROC FREQ. For stratified 2 × 2 tables, an exact test can be obtained using the STRATA statement and PERM= option in PROC MULTTEST. PROC LOGISTIC can also provide an exact test when the EXACT and STRATA statements are specified. For stratified R × 2 tables in which the R-level predictor is ordinal, LOGISTIC and MULTTEST can both provide exact tests. If the predictor is nominal, an exact test can be obtained from LOGISTIC. Exact tests for stratified tables are not available when the response is multinomial.
Stratified 2 × 2 tables
In this example, we want to obtain a test of the association between migraine treatment and the response adjusted for the two genders (strata). The CMH option in PROC FREQ provides an asymptotic test of the association.
data Migraine;
input Gender $ Treatment $ Response $ Count @@;
y=(response="Better");
datalines;
female Active Better 16 female Active Same 11
female Placebo Better 5 female Placebo Same 20
male Active Better 12 male Active Same 16
male Placebo Better 7 male Placebo Same 19
;
proc freq data=Migraine;
weight Count;
tables Gender*Treatment*Response / cmh noprint;
run;
1 |
8.3052 |
0.0040 |
1 |
8.3052 |
0.0040 |
1 |
8.3052 |
0.0040 |
|
The same asymptotic test is provided as the score test in PROC LOGISTIC when a STRATA statement is specified. By also including an EXACT statement, an exact score test of the association is given.
proc logistic data=Migraine;
class treatment / param=ref;
freq count;
model response=treatment;
strata gender;
exact treatment;
run;
8.4831 |
1 |
0.0036 |
8.3052 |
1 |
0.0040 |
7.9947 |
1 |
0.0047 |
8.3052 |
0.0051 |
0.0039 |
0.00242 |
0.0051 |
0.0039 |
|
The exact test can also be obtained from PROC MULTEST by specifying the STRATA statement, and the PERM= option to the Cochran-Armitage (CA) test. The value of the PERM= option should exceed the total in any stratum. The Model Information table displayed by MULTTEST should indicate Exact permutation distribution used: Everywhere. Note that MULTTEST requires a numerical response with the value 1 indicating the event of interest and value 0 indicating a nonevent. The variable Y was created in the DATA step above for this purpose.
proc multtest data=Migraine;
class treatment;
freq count;
test ca(y / perm=100);
strata gender;
run;
Cochran-Armitage |
Everywhere |
Two-tailed |
Sample size |
|
Stratified R × 2 tables
In this example, from Luta, et. al. (1998) and analyzed by Stokes et. al., each of eight animals (ANIMAL) undergoes several of four possible treatments (ORDTREAT) and it is observed whether a particular cardiovascular event (RESPONSE) occurs. The treatments are considered to have a logical ordering and are coded in proper increasing order. The first CMH statistic provided by the CMH option in PROC FREQ tests the linear association of the ordinal treatments with the response.
data animal;
input animal treatment $ response $ @@;
y=(response="yes");
if treatment='S' then delete;
else if treatment='C' then ordtreat=1;
else if treatment='DA' then ordtreat=2;
else if treatment='D1' then ordtreat=3;
else if treatment='D2' then ordtreat=4;
datalines;
1 S no 1 C no 1 C no 1 D2 yes 1 D1 yes
2 S no 2 D2 yes 2 C no 2 D1 yes
3 S no 3 C yes 3 D1 yes 3 DA no 3 C no
4 S no 4 C no 4 D1 yes 4 DA no 4 C no
5 S yes 5 C no 5 DA no 5 D1 no 5 C no
6 S no 6 C no 6 D1 yes 6 DA no 6 C no
7 S no 7 C no 7 D1 yes 7 DA no 7 C no
8 S yes 8 C yes 8 D1 yes
;
proc freq data=animal;
table animal*ordtreat*response / cmh noprint;
run;
1 |
10.4411 |
0.0012 |
3 |
14.4480 |
0.0024 |
3 |
14.4480 |
0.0024 |
|
As in the stratified 2 × 2 case, PROC LOGISTIC with the STRATA statement provides the asymptotic test from PROC FREQ as the score test. By including the EXACT statement, an exact score test is also provided.
proc logistic data=animal;
strata animal;
model response(event="yes") = ordtreat;
exact ordtreat;
run;
12.0716 |
1 |
0.0005 |
10.4411 |
1 |
0.0012 |
4.7275 |
1 |
0.0297 |
10.4411 |
0.0009 |
0.0005 |
0.000723 |
0.0009 |
0.0005 |
|
Again, using a properly coded response (Y), the STRATA statement and PERM= option in PROC MULTTEST allow you to get an exact test in this situation. The CONTRAST statement ensures that the numeric scores assigned to the levels of ORDTREAT are used in computing the test.
proc multtest data=animal;
class ordtreat;
test ca(y / perm=5);
strata animal;
contrast 'ordtreat' 1 2 3 4;
run;
If the treatments had no logical ordering, or if it is desired to ignore their ordinality, the asymptotic test comparing the treatments is available as the second CMH statistic from PROC FREQ, labeled "Row Mean Scores Differ". By including ORDTREAT in the CLASS statement, PROC LOGISTIC also provides the asymptotic score test, and if the EXACT statement is specified an exact score test is also obtained. The asymptotic analysis results in a singular information matrix making those results unusable, but the asymptotic and exact score tests can be used. Note that by adding the EXACTONLY option in the PROC LOGISTIC statement, the asymptotic analysis could be suppressed which prevents the warning messages about singularity caused by that analysis.
proc logistic data=animal;
strata animal;
class ordtreat / param=ref;
model response(event="yes") = ordtreat;
exact ordtreat;
run;
16.2957 |
3 |
0.0010 |
14.4480 |
3 |
0.0024 |
. |
2 |
. |
14.4480 |
0.0004 |
0.0003 |
0.000289 |
0.0017 |
0.0016 |
|
_____
Dmitrienko, A., Molenberghs, G., Chuang-Stein, C., and Offen, W. (2005), Analysis of Clinical Trials Using SAS: A Practical Guide, Cary, NC: SAS Institute.
Luta, G., Koch, G.G., Cascio, W.E., and Smith, W.T. (1998), "An application of methods for clustered binary responses to a cardiovascular study with small sample size," Journal of Biopharmaceutical Statistics, 8, 87-102.
Stokes, M.E., Davis, C.S., and Koch, G.G.
Operating System and Release Information
SAS System | SAS/STAT | Microsoft Windows 2000 Advanced Server | | |
OpenVMS VAX | | |
Microsoft® Windows® for 64-Bit Itanium-based Systems | | |
Microsoft Windows Server 2003 Datacenter 64-bit Edition | | |
Microsoft Windows Server 2003 Enterprise 64-bit Edition | | |
Microsoft Windows XP 64-bit Edition | | |
Microsoft® Windows® for x64 | | |
OS/2 | | |
Microsoft Windows 95/98 | | |
z/OS | | |
Microsoft Windows 2000 Datacenter Server | | |
Microsoft Windows 2000 Server | | |
Microsoft Windows 2000 Professional | | |
Microsoft Windows NT Workstation | | |
Microsoft Windows Server 2003 Datacenter Edition | | |
Microsoft Windows Server 2003 Enterprise Edition | | |
Microsoft Windows Server 2003 Standard Edition | | |
Microsoft Windows XP Professional | | |
Windows Millennium Edition (Me) | | |
Windows Vista | | |
64-bit Enabled AIX | | |
64-bit Enabled HP-UX | | |
64-bit Enabled Solaris | | |
ABI+ for Intel Architecture | | |
AIX | | |
HP-UX | | |
HP-UX IPF | | |
IRIX | | |
Linux | | |
Linux for x64 | | |
Linux on Itanium | | |
OpenVMS Alpha | | |
OpenVMS on HP Integrity | | |
Solaris | | |
Solaris for x64 | | |
Tru64 UNIX | | |
*
For software releases that are not yet generally available, the Fixed
Release is the software release in which the problem is planned to be
fixed.