<?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: frequency tables and ChiSqu in SAS Programming</title>
    <link>https://communities.sas.com/t5/SAS-Programming/frequency-tables-and-ChiSqu/m-p/349770#M81215</link>
    <description>&lt;P&gt;One way to get analysis for each level of a variable is to use a BY statement, which would require sorting the data by any variables&amp;nbsp;on the by stateement.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;PROC FREQ;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&amp;nbsp; by smi;&lt;BR /&gt;&amp;nbsp;&amp;nbsp; TABLES income* MentalSer / chisq relrisk;&lt;BR /&gt;RUN;&lt;/P&gt;
&lt;P&gt;Or&lt;/P&gt;
&lt;P&gt;PROC FREQ;&lt;/P&gt;
&lt;P&gt;&lt;BR /&gt;&amp;nbsp;&amp;nbsp; TABLES smi*income* MentalSer / chisq relrisk;&lt;BR /&gt;RUN; Which produce a separate table for each smi level.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;If you are only interested in one specific level you can use&lt;/P&gt;
&lt;P&gt;PROC FREQ;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;where smi='Yes'; /*&amp;nbsp;&amp;lt;= the value&amp;nbsp; has to be actual values of the variable */&lt;BR /&gt;&amp;nbsp;&amp;nbsp; TABLES income* MentalSer / chisq relrisk;&lt;BR /&gt;RUN;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;The approach you take would depend on what you are doing over all. Proc Freq can have multiple TABLES statements each with separate options. you could get both analysis&amp;nbsp; with&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Proc freq;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&amp;nbsp; tables MentalSer*SMI/ chisq or;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&amp;nbsp; tables smi*MentalSer*income/ chisq relrisk;&lt;/P&gt;
&lt;P&gt;run;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;The BY and WHERE would restrict analysis for all records where the separate tables statments would use all records.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Thu, 13 Apr 2017 14:33:48 GMT</pubDate>
    <dc:creator>ballardw</dc:creator>
    <dc:date>2017-04-13T14:33:48Z</dc:date>
    <item>
      <title>frequency tables and ChiSqu</title>
      <link>https://communities.sas.com/t5/SAS-Programming/frequency-tables-and-ChiSqu/m-p/349682#M81159</link>
      <description>&lt;P&gt;Among a population, I want to see if there is a significant relationship between&amp;nbsp;being SMI and receiving MHcare using frequency tables and ChiSqu, and there was.&lt;/P&gt;&lt;PRE class="aLF-aPX-K0-aPE aLF-aPX-aLK-ayr-auR"&gt;PROC FREQ; 
table MentalSer*SMI/ chisq or;
RUN;&lt;/PRE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;****Now I want to further investigate to see if there is a relationship between income and those who received MHcare among those who said "yes" to SMI. How do I conduct a frequency table, ChiSqu Odd Ratio? Should I use a control statement? If so, how?&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Also, when to us Odd Ratio or Relrisk?&lt;/P&gt;&lt;PRE class="aLF-aPX-K0-aPE aLF-aPX-aLK-ayr-auR"&gt;PROC FREQ;
	TABLES SMI * MentalSer / chisq relrisk;
RUN;&lt;/PRE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 13 Apr 2017 07:03:56 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/frequency-tables-and-ChiSqu/m-p/349682#M81159</guid>
      <dc:creator>Tamara3</dc:creator>
      <dc:date>2017-04-13T07:03:56Z</dc:date>
    </item>
    <item>
      <title>Re: frequency tables and ChiSqu</title>
      <link>https://communities.sas.com/t5/SAS-Programming/frequency-tables-and-ChiSqu/m-p/349770#M81215</link>
      <description>&lt;P&gt;One way to get analysis for each level of a variable is to use a BY statement, which would require sorting the data by any variables&amp;nbsp;on the by stateement.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;PROC FREQ;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&amp;nbsp; by smi;&lt;BR /&gt;&amp;nbsp;&amp;nbsp; TABLES income* MentalSer / chisq relrisk;&lt;BR /&gt;RUN;&lt;/P&gt;
&lt;P&gt;Or&lt;/P&gt;
&lt;P&gt;PROC FREQ;&lt;/P&gt;
&lt;P&gt;&lt;BR /&gt;&amp;nbsp;&amp;nbsp; TABLES smi*income* MentalSer / chisq relrisk;&lt;BR /&gt;RUN; Which produce a separate table for each smi level.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;If you are only interested in one specific level you can use&lt;/P&gt;
&lt;P&gt;PROC FREQ;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;where smi='Yes'; /*&amp;nbsp;&amp;lt;= the value&amp;nbsp; has to be actual values of the variable */&lt;BR /&gt;&amp;nbsp;&amp;nbsp; TABLES income* MentalSer / chisq relrisk;&lt;BR /&gt;RUN;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;The approach you take would depend on what you are doing over all. Proc Freq can have multiple TABLES statements each with separate options. you could get both analysis&amp;nbsp; with&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Proc freq;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&amp;nbsp; tables MentalSer*SMI/ chisq or;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&amp;nbsp; tables smi*MentalSer*income/ chisq relrisk;&lt;/P&gt;
&lt;P&gt;run;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;The BY and WHERE would restrict analysis for all records where the separate tables statments would use all records.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 13 Apr 2017 14:33:48 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/frequency-tables-and-ChiSqu/m-p/349770#M81215</guid>
      <dc:creator>ballardw</dc:creator>
      <dc:date>2017-04-13T14:33:48Z</dc:date>
    </item>
    <item>
      <title>Re: frequency tables and ChiSqu</title>
      <link>https://communities.sas.com/t5/SAS-Programming/frequency-tables-and-ChiSqu/m-p/350999#M81662</link>
      <description>&lt;P&gt;Those&amp;nbsp;codes worked. &lt;span class="lia-unicode-emoji" title=":slightly_smiling_face:"&gt;🙂&lt;/span&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thank you for your help.&amp;nbsp;&lt;img id="womanvery-happy" class="emoticon emoticon-womanvery-happy" src="https://communities.sas.com/i/smilies/16x16_woman-very-happy.png" alt="Woman Very Happy" title="Woman Very Happy" /&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 18 Apr 2017 19:21:12 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/frequency-tables-and-ChiSqu/m-p/350999#M81662</guid>
      <dc:creator>Tamara3</dc:creator>
      <dc:date>2017-04-18T19:21:12Z</dc:date>
    </item>
  </channel>
</rss>

