<?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: Prep data for Fisher's exact test in SAS Programming</title>
    <link>https://communities.sas.com/t5/SAS-Programming/Prep-data-for-Fisher-s-exact-test/m-p/864840#M341508</link>
    <description>This gives you p-values, but one assumption of the Fisher's exact test is that the subjects are independent. You appear to have repeated measurements and so a different test is likely necessary.</description>
    <pubDate>Fri, 17 Mar 2023 14:06:55 GMT</pubDate>
    <dc:creator>svh</dc:creator>
    <dc:date>2023-03-17T14:06:55Z</dc:date>
    <item>
      <title>Prep data for Fisher's exact test</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Prep-data-for-Fisher-s-exact-test/m-p/864356#M341355</link>
      <description>&lt;P&gt;I have data formatted as follows:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;data have;
 input ID DOSENUM TRTN RESULT $ @@;
 cards;
 1	1	1	Y
 1	2	1	N
 1	3	1	N
 2	1	1	N
 2	2	1	N
 2	3	1	Y
 3	1	1	N
 3	2	1	Y
 4	1	2	N
 4	2	2	N
 4	3	2	N
 5	1	2	N
 5	2	2	Y
 6	1	2	N
 6	2	2	Y
 6	3	2	Y
 ;
run;
&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;I want to find the p-value of Fisher's exact test comparing TRTN=1 to TRTN=2 for each dose. I am having a bit difficulty conceptualizing what needs to be tabled in PROC FREQ... I was thinking of doing the following, but am unsure if it gives me the p-value I want.&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;proc freq data= have; by DOSENUM; tables TRTN*RESULT/ fisher; run;&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Wed, 15 Mar 2023 16:01:31 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Prep-data-for-Fisher-s-exact-test/m-p/864356#M341355</guid>
      <dc:creator>mariko5797</dc:creator>
      <dc:date>2023-03-15T16:01:31Z</dc:date>
    </item>
    <item>
      <title>Re: Prep data for Fisher's exact test</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Prep-data-for-Fisher-s-exact-test/m-p/864840#M341508</link>
      <description>This gives you p-values, but one assumption of the Fisher's exact test is that the subjects are independent. You appear to have repeated measurements and so a different test is likely necessary.</description>
      <pubDate>Fri, 17 Mar 2023 14:06:55 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Prep-data-for-Fisher-s-exact-test/m-p/864840#M341508</guid>
      <dc:creator>svh</dc:creator>
      <dc:date>2023-03-17T14:06:55Z</dc:date>
    </item>
    <item>
      <title>Re: Prep data for Fisher's exact test</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Prep-data-for-Fisher-s-exact-test/m-p/864849#M341511</link>
      <description>&lt;P&gt;When you do a BY-group analysis of data, you need to make sure that the data are sorted by the BY-group variable. Before calling PROC FREQ, use the following call to PROC SORT:&lt;BR /&gt;&lt;BR /&gt;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;proc sort data=have;
   by DOSENUM;
run;&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Fri, 17 Mar 2023 14:30:06 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Prep-data-for-Fisher-s-exact-test/m-p/864849#M341511</guid>
      <dc:creator>Rick_SAS</dc:creator>
      <dc:date>2023-03-17T14:30:06Z</dc:date>
    </item>
    <item>
      <title>Re: Prep data for Fisher's exact test</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Prep-data-for-Fisher-s-exact-test/m-p/864973#M341550</link>
      <description>&lt;P&gt;Alternatively,&amp;nbsp;add DOSENUM as a stratification variable to the TABLES statement:&lt;/P&gt;
&lt;PRE&gt;tables &lt;STRONG&gt;&lt;FONT color="#3366FF"&gt;DOSENUM*&lt;/FONT&gt;&lt;/STRONG&gt;TRTN*RESULT/ fisher;&lt;/PRE&gt;
&lt;P&gt;With that you can use the existing (unsorted) HAVE dataset, omit the BY statement and still obtain the same result: Fisher's exact test applied separately to the three dose groups.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;However, from your description ("&lt;SPAN&gt;the p-value") I'm not sure&amp;nbsp;&lt;/SPAN&gt;if you want &lt;EM&gt;three&lt;/EM&gt; p-values or rather a &lt;EM&gt;single&lt;/EM&gt; p-value, maybe from an exact test for the &lt;EM&gt;common&lt;/EM&gt; odds ratio,&amp;nbsp;&lt;EM&gt;adjusting&lt;/EM&gt; for DOSENUM, if appropriate for your data. This would be a kind of&amp;nbsp;generalization of Fisher's exact test and could be requested by an&amp;nbsp;&lt;A href="https://documentation.sas.com/doc/en/pgmsascdc/9.4_3.5/procstat/procstat_freq_syntax03.htm" target="_blank" rel="noopener"&gt;EXACT statement&lt;/A&gt;&amp;nbsp;(&lt;FONT face="courier new,courier"&gt;exact comor;&lt;/FONT&gt;).&lt;/P&gt;</description>
      <pubDate>Fri, 17 Mar 2023 19:39:04 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Prep-data-for-Fisher-s-exact-test/m-p/864973#M341550</guid>
      <dc:creator>FreelanceReinh</dc:creator>
      <dc:date>2023-03-17T19:39:04Z</dc:date>
    </item>
  </channel>
</rss>

