Did you run an exact McNemar test?
data have;
input view success count ;
datalines;
1 1 30
1 0 0
2 1 26
2 0 4
;
run;
proc freq data=have;
weight count;
tables view*success / agree;
exact mcnem;
run;
Did you try logistic regression via PROC CATMOD ?
or POINT option of PROC FREQ.
data x;
input x $ Y $ w;
cards;
a a 30
a b 0
b a 26
b b 4
;
run;
proc freq data=x;
table x*y/fisher;
exact fisher /point;
weight w;
run;
Did you run an exact McNemar test?
data have;
input view success count ;
datalines;
1 1 30
1 0 0
2 1 26
2 0 4
;
run;
proc freq data=have;
weight count;
tables view*success / agree;
exact mcnem;
run;
Thank you @Miracle!
Much appreciate you pointing me in the right direction.
My data set is paired and binary, and has multiple zero cells. So definitely a McNemar exact test and I specified the zeros option, so that SAS recognizes the zero cells in the calculation.
After rearranging the data set appropriately for a McNemar test, it looked like this.
The code to run in this situation is:
data viewcomp;
input view1 $ view2 $ count;
cards;
Success Success 26
Success Failure 4
Failure Success 0
Failure Failure 0
;
run;
proc freq data = viewcomp;
weight count / zeros;
tables view1*view2 / agree;
exact mcnem;
run;
@Ahmed_Hegazy You should have marked @Miracle answer as correct, not your own.
@Miracletakes credit for pointing me in the right direction with the exact test, so happy to do that.
For future reference, and for who-ever reads this post I will point out the following. The correct data arrangement for this answer stem is presented in @Ahmed_Hegazyanswer. In addition, the zeros statement makes SAS use the zero cell for the calculation. So the SAS code presented in my answer is the one to be used for this stem.@Miracle is to be thanked (profusely) for his contribution.
You presented two tables, see your initial post - they are different outcomes.
He used the first one...there's really no way to have known which one was correct, after all, it's your data.
Yes @Ahmed_Hegazy, you are correct in terms of the data structure to do the tests.
We always learn from each other
Are you ready for the spotlight? We're accepting content ideas for SAS Innovate 2025 to be held May 6-9 in Orlando, FL. The call is open until September 25. Read more here about why you should contribute and what is in it for you!
ANOVA, or Analysis Of Variance, is used to compare the averages or means of two or more populations to better understand how they differ. Watch this tutorial for more.
Find more tutorials on the SAS Users YouTube channel.