Why can't SAS compute McNemar's test when zeros are in a column? I think that it is because SAS doesn't "know" that there are zeros.
For example, consider the following data set for a hypothetical case-control study.
data one;
input caseevent controlevent number;
cards;
0 0 0
0 1 9
1 0 0
1 1 15
;
run;
In this data set, controls are matched to cases. We have 0 case-control pairs where both the case and the control do NOT have the event.
There are 15 pairs where they both have the case.
For discordant pairs, we have 9 instances where the control had an event, and the case did not.
Also, we have 0 instances where the case had an event, and the case did not.
Running PROC FREQ and requesting McNemar test:
proc freq data=one;
tables caseevent*controlevent / agree;
weight number;
exact mcnemar;
run;
We get the appropriate table
But, there is no McNemar test and SAS log gives a NOTE:
So, apparently SAS thinks we are missing data.
I can calculate McNemar test (with or without continuity correction) manually. In this case X2=(|9-0|^2)/9=9 with one degree of freedom.
Or continuity corrected X2=((|9-0|-1)^2)/9=7.1.
But, it there some way to get sas to do this without having to program it? Further, I would prefer the Exact McNemar test. But, maybe I just need to program conditional Binomial tests for this.
... View more