<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>topic Re: McNemar Test with a Zero Cell in Statistical Procedures</title>
    <link>https://communities.sas.com/t5/Statistical-Procedures/McNemar-Test-with-a-Zero-Cell/m-p/428364#M22500</link>
    <description>&lt;P&gt;Yes&amp;nbsp;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/185289"&gt;@Ahmed_Hegazy&lt;/a&gt;, you are correct in terms of the data structure to do the tests.&lt;/P&gt;&lt;P&gt;&lt;SPAN class=""&gt;We always&amp;nbsp;&lt;/SPAN&gt;&lt;SPAN class=""&gt;learn&lt;/SPAN&gt;&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;SPAN class=""&gt;from each other&lt;/SPAN&gt;&lt;SPAN&gt;&amp;nbsp;&lt;img id="smileyhappy" class="emoticon emoticon-smileyhappy" src="https://communities.sas.com/i/smilies/16x16_smiley-happy.png" alt="Smiley Happy" title="Smiley Happy" /&gt;&lt;/SPAN&gt;&lt;/P&gt;</description>
    <pubDate>Wed, 17 Jan 2018 13:55:18 GMT</pubDate>
    <dc:creator>Miracle</dc:creator>
    <dc:date>2018-01-17T13:55:18Z</dc:date>
    <item>
      <title>McNemar Test with a Zero Cell</title>
      <link>https://communities.sas.com/t5/Statistical-Procedures/McNemar-Test-with-a-Zero-Cell/m-p/425577#M22375</link>
      <description>How do you analyse and obtain a p-value from a 2*2 table examining a binary outcome that is paired, when one cell has zero events?&lt;BR /&gt;&lt;BR /&gt;To clarify, I was looking at the success rate of obtaining an adequate image, using two different ultrasound windows, in the same participant. Then we repeated this experiment for 30 different participants.&lt;BR /&gt;&lt;BR /&gt;So each participant had the two views attempted, and the success rates of obtaining a good view for each attempt was recorded. So the data is paired, and our results are as follows:&lt;BR /&gt;Success Failure&lt;BR /&gt;View 1 30 0&lt;BR /&gt;View 2 26 4&lt;BR /&gt;&lt;BR /&gt;My understanding is that I cannot run a Fisher’s exact test as the data is not independent. And it will not run anyways with a zero value cell.&lt;BR /&gt;&lt;BR /&gt;So I tried rearranging the data and running a McNemar test.&lt;BR /&gt;&lt;BR /&gt;View 2&lt;BR /&gt;Success Failure&lt;BR /&gt;View 1 Success 26 4&lt;BR /&gt;Failure 0 0&lt;BR /&gt;&lt;BR /&gt;But the McNemar would not run because of the zero value in cell c.&lt;BR /&gt;&lt;BR /&gt;I needed a p-value for these results and I’m at a loss as to what to do! I use SAS for analysis. Any pointers would be much appreciated.</description>
      <pubDate>Sun, 07 Jan 2018 05:42:06 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Statistical-Procedures/McNemar-Test-with-a-Zero-Cell/m-p/425577#M22375</guid>
      <dc:creator>Ahmed_Hegazy</dc:creator>
      <dc:date>2018-01-07T05:42:06Z</dc:date>
    </item>
    <item>
      <title>Re: McNemar Test with a Zero Cell</title>
      <link>https://communities.sas.com/t5/Statistical-Procedures/McNemar-Test-with-a-Zero-Cell/m-p/425581#M22376</link>
      <description>&lt;P&gt;Did you try logistic regression via PROC CATMOD ?&lt;/P&gt;
&lt;P&gt;or POINT option of PROC FREQ.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;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;&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Sun, 07 Jan 2018 11:00:07 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Statistical-Procedures/McNemar-Test-with-a-Zero-Cell/m-p/425581#M22376</guid>
      <dc:creator>Ksharp</dc:creator>
      <dc:date>2018-01-07T11:00:07Z</dc:date>
    </item>
    <item>
      <title>Re: McNemar Test with a Zero Cell</title>
      <link>https://communities.sas.com/t5/Statistical-Procedures/McNemar-Test-with-a-Zero-Cell/m-p/425589#M22377</link>
      <description>&lt;P&gt;&lt;FONT face="andale mono,times"&gt;Did you run an exact McNemar test?&lt;/FONT&gt;&lt;/P&gt;&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;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;&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Sun, 07 Jan 2018 14:51:51 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Statistical-Procedures/McNemar-Test-with-a-Zero-Cell/m-p/425589#M22377</guid>
      <dc:creator>Miracle</dc:creator>
      <dc:date>2018-01-07T14:51:51Z</dc:date>
    </item>
    <item>
      <title>Re: McNemar Test with a Zero Cell</title>
      <link>https://communities.sas.com/t5/Statistical-Procedures/McNemar-Test-with-a-Zero-Cell/m-p/425620#M22379</link>
      <description>&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/16719"&gt;@Miracle&lt;/a&gt; is correct, when you have 0 cells, you can do an exact test. You may want to pay close attention to your estimates however, especially the confidence intervals so that they don't go below 0.</description>
      <pubDate>Sun, 07 Jan 2018 20:08:16 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Statistical-Procedures/McNemar-Test-with-a-Zero-Cell/m-p/425620#M22379</guid>
      <dc:creator>Reeza</dc:creator>
      <dc:date>2018-01-07T20:08:16Z</dc:date>
    </item>
    <item>
      <title>Re: McNemar Test with a Zero Cell</title>
      <link>https://communities.sas.com/t5/Statistical-Procedures/McNemar-Test-with-a-Zero-Cell/m-p/427929#M22483</link>
      <description>&lt;P&gt;Thank you &lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/16719"&gt;@Miracle&lt;/a&gt;!&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Much appreciate you pointing me in the right direction.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;My data set is paired and binary, and has multiple zero cells. So definitely a McNemar &lt;STRONG&gt;exact&lt;/STRONG&gt; test and I specified the &lt;STRONG&gt;zeros&lt;/STRONG&gt; option, so that SAS recognizes the zero cells in the calculation.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;After rearranging the data set appropriately for a McNemar test, it looked like this.&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="Capture.JPG" style="width: 400px;"&gt;&lt;img src="https://communities.sas.com/t5/image/serverpage/image-id/17902iEF1884D43336B137/image-size/medium?v=v2&amp;amp;px=400" role="button" title="Capture.JPG" alt="Capture.JPG" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;The code to run in this situation is:&lt;/P&gt;&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;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; &lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Tue, 16 Jan 2018 07:04:27 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Statistical-Procedures/McNemar-Test-with-a-Zero-Cell/m-p/427929#M22483</guid>
      <dc:creator>Ahmed_Hegazy</dc:creator>
      <dc:date>2018-01-16T07:04:27Z</dc:date>
    </item>
    <item>
      <title>Re: McNemar Test with a Zero Cell</title>
      <link>https://communities.sas.com/t5/Statistical-Procedures/McNemar-Test-with-a-Zero-Cell/m-p/428054#M22492</link>
      <description>&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/185289"&gt;@Ahmed_Hegazy&lt;/a&gt;&amp;nbsp;You should have marked&amp;nbsp;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/16719"&gt;@Miracle&lt;/a&gt;&amp;nbsp;answer as correct, not your own.&lt;/P&gt;</description>
      <pubDate>Tue, 16 Jan 2018 15:42:38 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Statistical-Procedures/McNemar-Test-with-a-Zero-Cell/m-p/428054#M22492</guid>
      <dc:creator>Reeza</dc:creator>
      <dc:date>2018-01-16T15:42:38Z</dc:date>
    </item>
    <item>
      <title>Re: McNemar Test with a Zero Cell</title>
      <link>https://communities.sas.com/t5/Statistical-Procedures/McNemar-Test-with-a-Zero-Cell/m-p/428095#M22495</link>
      <description>&lt;P&gt;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/16719"&gt;@Miracle&lt;/a&gt;takes credit for pointing me in the right direction with the exact test, so happy to do that.&lt;BR /&gt;&lt;BR /&gt;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 &lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/185289"&gt;@Ahmed_Hegazy&lt;/a&gt;answer. In addition, the &lt;STRONG&gt;zeros&lt;/STRONG&gt; 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.&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/16719"&gt;@Miracle&lt;/a&gt; is to be thanked (profusely) for his contribution.&lt;/P&gt;</description>
      <pubDate>Tue, 16 Jan 2018 17:03:22 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Statistical-Procedures/McNemar-Test-with-a-Zero-Cell/m-p/428095#M22495</guid>
      <dc:creator>Ahmed_Hegazy</dc:creator>
      <dc:date>2018-01-16T17:03:22Z</dc:date>
    </item>
    <item>
      <title>Re: McNemar Test with a Zero Cell</title>
      <link>https://communities.sas.com/t5/Statistical-Procedures/McNemar-Test-with-a-Zero-Cell/m-p/428098#M22496</link>
      <description>&lt;P&gt;You presented two tables, see your initial post - they are different outcomes.&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;He used the first one...there's really no way to have known which one was correct, after all, it's your data.&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 16 Jan 2018 17:14:31 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Statistical-Procedures/McNemar-Test-with-a-Zero-Cell/m-p/428098#M22496</guid>
      <dc:creator>Reeza</dc:creator>
      <dc:date>2018-01-16T17:14:31Z</dc:date>
    </item>
    <item>
      <title>Re: McNemar Test with a Zero Cell</title>
      <link>https://communities.sas.com/t5/Statistical-Procedures/McNemar-Test-with-a-Zero-Cell/m-p/428109#M22497</link>
      <description>In the stem, I mention rearranging the data to run a McNemar test. This is key to getting the right result. And this is the table to be used.&lt;BR /&gt;&lt;BR /&gt;The first table would be appropriate for a running a Fisher’s exact or Chi square with independent outcomes, which is not applicable to this scenario.</description>
      <pubDate>Tue, 16 Jan 2018 17:39:33 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Statistical-Procedures/McNemar-Test-with-a-Zero-Cell/m-p/428109#M22497</guid>
      <dc:creator>Ahmed_Hegazy</dc:creator>
      <dc:date>2018-01-16T17:39:33Z</dc:date>
    </item>
    <item>
      <title>Re: McNemar Test with a Zero Cell</title>
      <link>https://communities.sas.com/t5/Statistical-Procedures/McNemar-Test-with-a-Zero-Cell/m-p/428364#M22500</link>
      <description>&lt;P&gt;Yes&amp;nbsp;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/185289"&gt;@Ahmed_Hegazy&lt;/a&gt;, you are correct in terms of the data structure to do the tests.&lt;/P&gt;&lt;P&gt;&lt;SPAN class=""&gt;We always&amp;nbsp;&lt;/SPAN&gt;&lt;SPAN class=""&gt;learn&lt;/SPAN&gt;&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;SPAN class=""&gt;from each other&lt;/SPAN&gt;&lt;SPAN&gt;&amp;nbsp;&lt;img id="smileyhappy" class="emoticon emoticon-smileyhappy" src="https://communities.sas.com/i/smilies/16x16_smiley-happy.png" alt="Smiley Happy" title="Smiley Happy" /&gt;&lt;/SPAN&gt;&lt;/P&gt;</description>
      <pubDate>Wed, 17 Jan 2018 13:55:18 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Statistical-Procedures/McNemar-Test-with-a-Zero-Cell/m-p/428364#M22500</guid>
      <dc:creator>Miracle</dc:creator>
      <dc:date>2018-01-17T13:55:18Z</dc:date>
    </item>
  </channel>
</rss>

