<?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 how to create a table in SAS to perform a chi square test in SAS Procedures</title>
    <link>https://communities.sas.com/t5/SAS-Procedures/how-to-create-a-table-in-SAS-to-perform-a-chi-square-test/m-p/398403#M66588</link>
    <description>&lt;P&gt;Hi.&amp;nbsp;&lt;/P&gt;&lt;P&gt;I have this table below and I am trying to put the data in SAS to do some analysis.&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="Screen Shot 2017-09-24 at 1.32.35 PM.png" style="width: 600px;"&gt;&lt;img src="https://communities.sas.com/t5/image/serverpage/image-id/15380i8CB9E5F67DB5E05B/image-size/large?v=v2&amp;amp;px=999" role="button" title="Screen Shot 2017-09-24 at 1.32.35 PM.png" alt="Screen Shot 2017-09-24 at 1.32.35 PM.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;I am completly new in SAS so I am not sure the code I have below works fine.&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;DATA placeboStudy;&lt;BR /&gt;INPUT value Revascularization $ Treatment $ Study $;&lt;BR /&gt;DATALINES;&lt;BR /&gt;2 yes Niacin FATS&lt;BR /&gt;11 yes Placebo FATS&lt;BR /&gt;4 yes Niacin AFREGS&lt;BR /&gt;12 yes Placebo AFREGS&lt;BR /&gt;1 yes Niacin ARBITER 2&lt;BR /&gt;4 yes Placebo ARBITER 2&lt;BR /&gt;1 yes Niacin HATS&lt;BR /&gt;6 yes Placebo HATS&lt;BR /&gt;2 yes Niacin CLAS 1&lt;BR /&gt;1 yes Placebo CLAS 1&lt;BR /&gt;46 no Niacin FATS&lt;BR /&gt;41 no Placebo FATS&lt;BR /&gt;67 no Niacin AFREGS&lt;BR /&gt;60 no Placebo AFREGS&lt;BR /&gt;86 no Niacin ARBITER 2&lt;BR /&gt;76 no Placebo ARBITER 2&lt;BR /&gt;37 no Niacin HATS&lt;BR /&gt;32 no Placebo HATS&lt;BR /&gt;92 no Niacin CLAS 1&lt;BR /&gt;93 no Placebo CLAS 1&lt;BR /&gt;;&lt;BR /&gt;RUN;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I know how to work with R. I have tried to put the entries in R and did Chi square test. However, when I tried this code in SAS and performed chi square test, I got different results. What do you think is wrong with the code above?&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;* the question i am trying to asnwer is whether the&amp;nbsp;&lt;SPAN&gt;patients on niacin developed coronary artery revascularization more than patiens onPlacebo. The sas results I obtain with this code should a p value greater than 0.05 which seems to be incorrect.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;Thank you very much.&lt;/P&gt;</description>
    <pubDate>Sun, 24 Sep 2017 17:56:53 GMT</pubDate>
    <dc:creator>Sara73737</dc:creator>
    <dc:date>2017-09-24T17:56:53Z</dc:date>
    <item>
      <title>how to create a table in SAS to perform a chi square test</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/how-to-create-a-table-in-SAS-to-perform-a-chi-square-test/m-p/398403#M66588</link>
      <description>&lt;P&gt;Hi.&amp;nbsp;&lt;/P&gt;&lt;P&gt;I have this table below and I am trying to put the data in SAS to do some analysis.&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="Screen Shot 2017-09-24 at 1.32.35 PM.png" style="width: 600px;"&gt;&lt;img src="https://communities.sas.com/t5/image/serverpage/image-id/15380i8CB9E5F67DB5E05B/image-size/large?v=v2&amp;amp;px=999" role="button" title="Screen Shot 2017-09-24 at 1.32.35 PM.png" alt="Screen Shot 2017-09-24 at 1.32.35 PM.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;I am completly new in SAS so I am not sure the code I have below works fine.&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;DATA placeboStudy;&lt;BR /&gt;INPUT value Revascularization $ Treatment $ Study $;&lt;BR /&gt;DATALINES;&lt;BR /&gt;2 yes Niacin FATS&lt;BR /&gt;11 yes Placebo FATS&lt;BR /&gt;4 yes Niacin AFREGS&lt;BR /&gt;12 yes Placebo AFREGS&lt;BR /&gt;1 yes Niacin ARBITER 2&lt;BR /&gt;4 yes Placebo ARBITER 2&lt;BR /&gt;1 yes Niacin HATS&lt;BR /&gt;6 yes Placebo HATS&lt;BR /&gt;2 yes Niacin CLAS 1&lt;BR /&gt;1 yes Placebo CLAS 1&lt;BR /&gt;46 no Niacin FATS&lt;BR /&gt;41 no Placebo FATS&lt;BR /&gt;67 no Niacin AFREGS&lt;BR /&gt;60 no Placebo AFREGS&lt;BR /&gt;86 no Niacin ARBITER 2&lt;BR /&gt;76 no Placebo ARBITER 2&lt;BR /&gt;37 no Niacin HATS&lt;BR /&gt;32 no Placebo HATS&lt;BR /&gt;92 no Niacin CLAS 1&lt;BR /&gt;93 no Placebo CLAS 1&lt;BR /&gt;;&lt;BR /&gt;RUN;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I know how to work with R. I have tried to put the entries in R and did Chi square test. However, when I tried this code in SAS and performed chi square test, I got different results. What do you think is wrong with the code above?&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;* the question i am trying to asnwer is whether the&amp;nbsp;&lt;SPAN&gt;patients on niacin developed coronary artery revascularization more than patiens onPlacebo. The sas results I obtain with this code should a p value greater than 0.05 which seems to be incorrect.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;Thank you very much.&lt;/P&gt;</description>
      <pubDate>Sun, 24 Sep 2017 17:56:53 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/how-to-create-a-table-in-SAS-to-perform-a-chi-square-test/m-p/398403#M66588</guid>
      <dc:creator>Sara73737</dc:creator>
      <dc:date>2017-09-24T17:56:53Z</dc:date>
    </item>
    <item>
      <title>Re: how to create a table in SAS to perform a chi square test</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/how-to-create-a-table-in-SAS-to-perform-a-chi-square-test/m-p/398527#M66589</link>
      <description>&lt;PRE&gt;
you have three category variables.
and some cell freq &amp;lt; 5, so need Fisher exact test.




DATA placeboStudy;
INPUT value Revascularization $ Treatment $ Study $;
DATALINES;
2 yes Niacin FATS
11 yes Placebo FATS
4 yes Niacin AFREGS
12 yes Placebo AFREGS
1 yes Niacin ARBITER 2
4 yes Placebo ARBITER 2
1 yes Niacin HATS
6 yes Placebo HATS
2 yes Niacin CLAS 1
1 yes Placebo CLAS 1
46 no Niacin FATS
41 no Placebo FATS
67 no Niacin AFREGS
60 no Placebo AFREGS
86 no Niacin ARBITER 2
76 no Placebo ARBITER 2
37 no Niacin HATS
32 no Placebo HATS
92 no Niacin CLAS 1
93 no Placebo CLAS 1
;
RUN;
proc freq data=placeboStudy;
table Study*Revascularization*Treatment/cmh chisq  CELLCHI2 cmh2 fisher;
exact fisher;
weight value;
run;

&lt;/PRE&gt;</description>
      <pubDate>Mon, 25 Sep 2017 13:32:03 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/how-to-create-a-table-in-SAS-to-perform-a-chi-square-test/m-p/398527#M66589</guid>
      <dc:creator>Ksharp</dc:creator>
      <dc:date>2017-09-25T13:32:03Z</dc:date>
    </item>
  </channel>
</rss>

