<?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 3-way cross-tabulations (chi-square tests) in Statistical Procedures</title>
    <link>https://communities.sas.com/t5/Statistical-Procedures/3-way-cross-tabulations-chi-square-tests/m-p/38771#M1623</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I looked at proc tabulate and it's hard to figure out. I'm trying to understand which variable is designated as the control variable - is it the meta variable, i.e., schooltype? Here's some code I found: &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: black; font-family: 'Courier New'; font-size: 10pt;"&gt;proc freq data=kali.chks4 order=formatted ;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: black; font-family: 'Courier New'; font-size: 10pt;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; tables schooltype*(gender incident)/ noprint chisq measures cmh;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: black; font-family: 'Courier New'; font-size: 10pt;"&gt;run;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #000000; font-family: 'Courier New';"&gt;I simply want to see what gender*incident looks like by school type.&lt;BR /&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Mon, 31 Oct 2011 21:02:06 GMT</pubDate>
    <dc:creator>kvc</dc:creator>
    <dc:date>2011-10-31T21:02:06Z</dc:date>
    <item>
      <title>3-way cross-tabulations (chi-square tests)</title>
      <link>https://communities.sas.com/t5/Statistical-Procedures/3-way-cross-tabulations-chi-square-tests/m-p/38769#M1621</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I am trying to write code in SAS to do a 3-way cross tabulation. For example, if I have 3 categorical variables and I want to look at gender and incident by schooltype.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I wrote code as follows:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;proc freq data = mydata;&lt;/P&gt;&lt;P&gt;tables gender*incident*schooltype / chisq;&lt;/P&gt;&lt;P&gt;run;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;However, the output only shows a 2x2 table and gender was controlled for.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Can you help me figure out the correct code? Thank you.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 31 Oct 2011 20:07:55 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Statistical-Procedures/3-way-cross-tabulations-chi-square-tests/m-p/38769#M1621</guid>
      <dc:creator>kvc</dc:creator>
      <dc:date>2011-10-31T20:07:55Z</dc:date>
    </item>
    <item>
      <title>3-way cross-tabulations (chi-square tests)</title>
      <link>https://communities.sas.com/t5/Statistical-Procedures/3-way-cross-tabulations-chi-square-tests/m-p/38770#M1622</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;That is the way SAS outputs a 3 or more way crosstabulation.&amp;nbsp; If you wanted to achieve a different output you would have to design your own using something like proc report or proc tabulate.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 31 Oct 2011 20:18:25 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Statistical-Procedures/3-way-cross-tabulations-chi-square-tests/m-p/38770#M1622</guid>
      <dc:creator>art297</dc:creator>
      <dc:date>2011-10-31T20:18:25Z</dc:date>
    </item>
    <item>
      <title>3-way cross-tabulations (chi-square tests)</title>
      <link>https://communities.sas.com/t5/Statistical-Procedures/3-way-cross-tabulations-chi-square-tests/m-p/38771#M1623</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I looked at proc tabulate and it's hard to figure out. I'm trying to understand which variable is designated as the control variable - is it the meta variable, i.e., schooltype? Here's some code I found: &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: black; font-family: 'Courier New'; font-size: 10pt;"&gt;proc freq data=kali.chks4 order=formatted ;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: black; font-family: 'Courier New'; font-size: 10pt;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; tables schooltype*(gender incident)/ noprint chisq measures cmh;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: black; font-family: 'Courier New'; font-size: 10pt;"&gt;run;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #000000; font-family: 'Courier New';"&gt;I simply want to see what gender*incident looks like by school type.&lt;BR /&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 31 Oct 2011 21:02:06 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Statistical-Procedures/3-way-cross-tabulations-chi-square-tests/m-p/38771#M1623</guid>
      <dc:creator>kvc</dc:creator>
      <dc:date>2011-10-31T21:02:06Z</dc:date>
    </item>
    <item>
      <title>3-way cross-tabulations (chi-square tests)</title>
      <link>https://communities.sas.com/t5/Statistical-Procedures/3-way-cross-tabulations-chi-square-tests/m-p/38772#M1624</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I'm still not sure what you are trying to do.&amp;nbsp; Is is something like the following?:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;data test;&lt;/P&gt;&lt;P&gt;&amp;nbsp; set sashelp.class;&lt;/P&gt;&lt;P&gt;&amp;nbsp; if height gt 62 then height=1;&lt;/P&gt;&lt;P&gt;&amp;nbsp; else height=0;&lt;/P&gt;&lt;P&gt;&amp;nbsp; if weight gt 99 then weight=1;&lt;/P&gt;&lt;P&gt;&amp;nbsp; else weight=0;&lt;/P&gt;&lt;P&gt;run;&lt;/P&gt;&lt;P&gt;proc sort data=test;&lt;/P&gt;&lt;P&gt;&amp;nbsp; by sex;&lt;/P&gt;&lt;P&gt;run;&lt;/P&gt;&lt;P&gt;proc freq data=test ;&lt;/P&gt;&lt;P&gt;&amp;nbsp; tables height*weight/ chisq measures cmh;&lt;/P&gt;&lt;P&gt;&amp;nbsp; by sex;&lt;/P&gt;&lt;P&gt;run;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 31 Oct 2011 21:13:02 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Statistical-Procedures/3-way-cross-tabulations-chi-square-tests/m-p/38772#M1624</guid>
      <dc:creator>art297</dc:creator>
      <dc:date>2011-10-31T21:13:02Z</dc:date>
    </item>
    <item>
      <title>3-way cross-tabulations (chi-square tests)</title>
      <link>https://communities.sas.com/t5/Statistical-Procedures/3-way-cross-tabulations-chi-square-tests/m-p/38773#M1625</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;This is what I needed. I needed to run the cross tab by the school type. The output is kind of strange though. It gave me four tables, not two, with two tables containing output for one school type, and two tables containing output for another&amp;nbsp; school type. I wonder if my dataset is too large for one table? In any event, the code you gave me was great, so thank you very much.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 31 Oct 2011 23:56:50 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Statistical-Procedures/3-way-cross-tabulations-chi-square-tests/m-p/38773#M1625</guid>
      <dc:creator>kvc</dc:creator>
      <dc:date>2011-10-31T23:56:50Z</dc:date>
    </item>
  </channel>
</rss>

