![]() | ![]() | ![]() |
For matched pairs data with a binary response (such as yes/no responses from husband and wife pairs), the AGREE option in PROC FREQ provides a test of equal probability of a yes response. This is McNemar's test of marginal homogeneity.
However, as discussed by Fleiss (1981), an estimator other than the usual odds ratio estimator should be used for matched pairs data. An estimate of the odds ratio for matched pairs data can be obtained by using the STRATA statement in PROC LOGISTIC or PROC PHREG, rather than the RELRISK or MEASURES option in PROC FREQ.
Using the example presented by Fleiss (1981), the following statements compute McNemar's test (without continuity correction) and the usual odds ratio estimate when the data is not matched:
data a;
do case = 'present','absent';
do control = 'present','absent';
input count @@;
output;
end;
end;
datalines;
15 20
5 60
;
proc freq order=data;
weight count;
table case * control / agree relrisk;
run;
McNemar's test statistic is significant at p=0.0027. However, the odds ratio estimate from the RELRISK option does not account for the data being matched.
On the other hand, the following statements compute the appropriate odds ratio estimate and confidence interval for matched pairs data. The data must first be arranged in a stratified layout in which the pairs are the strata. An observation is created for each subject in each pair. Y=1 indicates the observation is a case; Y=2 indicates control. F=1 indicates the predictive factor is present; F=0 indicates the factor is absent. The variable S has a unique value for each pair so that the members in each pair have the same value of S.
The odds ratio can be computed via stratified analyses in the FREQ, LOGISTIC, or PHREG procedure. In PROC FREQ, specify a three-way table with the pair identifier, S, as a stratifying variable and specify the CMH option. The NOPRINT option suppresses printing of the table for each pair. In PROC LOGISTIC, the STRATA statement requests a conditional logistic model. PROC LOGISTIC provides point and confidence interval estimates of the odds ratio. The RL option in PROC PHREG provides a confidence interval for the odds ratio (which it labels as a hazard ratio). The optional EXACT statement can be used, beginning with SAS 9.1 of PROC LOGISTIC, to provide an exact conditional estimate and confidence interval of the odds ratio.
data a;
/* 15 pairs factor present in both case and control */
do s=1 to 15;
y=1; f=1; output;
y=2; f=1; output;
end;
/* 20 pairs factor present in case but not control */
do s=16 to 35;
y=1; f=1; output;
y=2; f=0; output;
end;
/* 5 pairs factor present in control but not case */
do s=36 to 40;
y=1; f=0; output;
y=2; f=1; output;
end;
/* 60 pairs factor absent in both case and control */
do s=41 to 100;
y=1; f=0; output;
y=2; f=0; output;
end;
run;
proc freq order=data;
table s*f*y / cmh noprint;
run;
proc logistic;
model y = f;
strata s;
exact f / estimate=odds;
run;
proc phreg;
model y = f / rl;
strata s;
run;
The correct estimate of the odds ratio from this matched pairs data is 4.0. A 95% asymptotic confidence interval for the odds ratio is (1.5, 10.7). PROC LOGISTIC provides an exact estimate and 95% confidence interval: 4.0 and (1.46, 13.64).
______
Fleiss, J. L. 1981. Statistical Methods for Rates
and Proportions. 2d ed. New York: John Wiley & Sons, Inc.
| Product Family | Product | System | SAS Release | |
| Reported | Fixed | |||
| SAS System | SAS/STAT | All | n/a | |
| Type: | Usage Note |
| Priority: | low |
| Topic: | SAS Reference ==> Procedures ==> PHREG Analytics ==> Nonparametric Analysis SAS Reference ==> Procedures ==> FREQ SAS Reference ==> Procedures ==> LOGISTIC Analytics ==> Categorical Data Analysis Analytics ==> Descriptive Statistics Analytics ==> Exact Methods Analytics ==> Longitudinal Analysis |
| Date Modified: | 2005-01-04 13:02:48 |
| Date Created: | 2002-12-16 10:56:39 |



