<?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: Analysis of a 2x2 Contingency Table in SAS Programming</title>
    <link>https://communities.sas.com/t5/SAS-Programming/Analysis-of-a-2x2-Contingency-Table/m-p/454281#M114809</link>
    <description>&lt;P&gt;As far as I remember, a simple comparison of proportions as you describe (which is not really a 2x2 contingency table at all) is not programmed into any SAS PROC. However, it is simple enough to program in data step.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;As is usual, &lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/13684"&gt;@Rick_SAS&lt;/a&gt; has written up the explanation at &lt;A href="https://blogs.sas.com/content/iml/2017/07/05/test-equality-two-proportions-sas.html" target="_blank"&gt;https://blogs.sas.com/content/iml/2017/07/05/test-equality-two-proportions-sas.html&lt;/A&gt;&lt;/P&gt;</description>
    <pubDate>Sun, 15 Apr 2018 18:30:43 GMT</pubDate>
    <dc:creator>PaigeMiller</dc:creator>
    <dc:date>2018-04-15T18:30:43Z</dc:date>
    <item>
      <title>Analysis of a 2x2 Contingency Table</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Analysis-of-a-2x2-Contingency-Table/m-p/454280#M114808</link>
      <description>&lt;P&gt;I want to create a crosstabulation table between Region and season:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;TABLE&gt;&lt;TBODY&gt;&lt;TR&gt;&lt;TD&gt;&amp;nbsp;&lt;/TD&gt;&lt;TD&gt;&lt;P&gt;Spring&lt;/P&gt;&lt;/TD&gt;&lt;TD&gt;&lt;P&gt;Summer&lt;/P&gt;&lt;/TD&gt;&lt;TD&gt;&lt;P&gt;p-value&lt;/P&gt;&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;&lt;P&gt;Region 1&lt;/P&gt;&lt;/TD&gt;&lt;TD&gt;&lt;P&gt;.. %&lt;/P&gt;&lt;/TD&gt;&lt;TD&gt;&lt;P&gt;&amp;nbsp;..%&lt;/P&gt;&lt;/TD&gt;&lt;TD&gt;&lt;P&gt;P1&lt;/P&gt;&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;&lt;P&gt;Region 2&lt;/P&gt;&lt;/TD&gt;&lt;TD&gt;&lt;P&gt;.. %&lt;/P&gt;&lt;/TD&gt;&lt;TD&gt;&lt;P&gt;.. %&lt;/P&gt;&lt;/TD&gt;&lt;TD&gt;&lt;P&gt;P2&lt;/P&gt;&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;&lt;P&gt;Region 3&lt;/P&gt;&lt;/TD&gt;&lt;TD&gt;&lt;P&gt;&amp;nbsp;..%&lt;/P&gt;&lt;/TD&gt;&lt;TD&gt;&lt;P&gt;.. %&lt;/P&gt;&lt;/TD&gt;&lt;TD&gt;&lt;P&gt;P3&lt;/P&gt;&lt;/TD&gt;&lt;/TR&gt;&lt;/TBODY&gt;&lt;/TABLE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I want to:&lt;/P&gt;&lt;P&gt;Check if the % of people in region 1 is different between spring and summer (p-value or OR)&lt;/P&gt;&lt;P&gt;Check if the % of people in region 2 is different between spring and summer (p-value or OR)&lt;/P&gt;&lt;P&gt;Check if the % of people in region 3 is different between spring and summer (p-value or OR)&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;What test should I use to&amp;nbsp;get the 3 p-values needed?&lt;/STRONG&gt;&lt;/P&gt;</description>
      <pubDate>Sun, 15 Apr 2018 18:22:11 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Analysis-of-a-2x2-Contingency-Table/m-p/454280#M114808</guid>
      <dc:creator>sebai</dc:creator>
      <dc:date>2018-04-15T18:22:11Z</dc:date>
    </item>
    <item>
      <title>Re: Analysis of a 2x2 Contingency Table</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Analysis-of-a-2x2-Contingency-Table/m-p/454281#M114809</link>
      <description>&lt;P&gt;As far as I remember, a simple comparison of proportions as you describe (which is not really a 2x2 contingency table at all) is not programmed into any SAS PROC. However, it is simple enough to program in data step.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;As is usual, &lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/13684"&gt;@Rick_SAS&lt;/a&gt; has written up the explanation at &lt;A href="https://blogs.sas.com/content/iml/2017/07/05/test-equality-two-proportions-sas.html" target="_blank"&gt;https://blogs.sas.com/content/iml/2017/07/05/test-equality-two-proportions-sas.html&lt;/A&gt;&lt;/P&gt;</description>
      <pubDate>Sun, 15 Apr 2018 18:30:43 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Analysis-of-a-2x2-Contingency-Table/m-p/454281#M114809</guid>
      <dc:creator>PaigeMiller</dc:creator>
      <dc:date>2018-04-15T18:30:43Z</dc:date>
    </item>
    <item>
      <title>Re: Analysis of a 2x2 Contingency Table</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Analysis-of-a-2x2-Contingency-Table/m-p/454285#M114810</link>
      <description>&lt;P&gt;It's not a 2X2 table, since it's literally a 1 (row=REGION) X 2 (column=SEASON) comparison.&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;One way would be to use a BY statement in the PROC FREQ.&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Here's an example that gets the binomial test, which tests that the proportions should be 50% in each group. Note that you'll need the N's here, NOT the percentages. You need both the N and percentages or the raw data.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;proc sort data=sashelp.class out=class; by age sex; run;

ods output binomialTest=pvalues;
proc freq data=class;
by age;
table sex / out=summary_table chisq binomial;
run;&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;PS. The reusults are not in a nice neat table, but all the information is in the two output tables:&lt;/P&gt;
&lt;OL&gt;
&lt;LI&gt;Summary_Table -&amp;gt; has the counts and percentages&lt;/LI&gt;
&lt;LI&gt;Values -&amp;gt; has the p-values for each test&lt;/LI&gt;
&lt;/OL&gt;</description>
      <pubDate>Sun, 15 Apr 2018 19:25:50 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Analysis-of-a-2x2-Contingency-Table/m-p/454285#M114810</guid>
      <dc:creator>Reeza</dc:creator>
      <dc:date>2018-04-15T19:25:50Z</dc:date>
    </item>
  </channel>
</rss>

