<?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: Chi square in Statistical Procedures</title>
    <link>https://communities.sas.com/t5/Statistical-Procedures/Chi-square/m-p/64312#M3056</link>
    <description>Hello L&amp;amp;L,&lt;BR /&gt;
&lt;BR /&gt;
Is this what you need?&lt;BR /&gt;
[pre]&lt;BR /&gt;
ODS output CHISQ=Chi (keep=Statistic Prob where=(Statistic="Chi-Square"));&lt;BR /&gt;
proc freq data=SASHELP.CLASS;&lt;BR /&gt;
  table sex*age/out=freq chisq;&lt;BR /&gt;
run; &lt;BR /&gt;
proc transpose data=freq out=r(drop=_:) prefix=Age_;&lt;BR /&gt;
  var percent;&lt;BR /&gt;
  id age;&lt;BR /&gt;
  by sex;&lt;BR /&gt;
run;&lt;BR /&gt;
data r;&lt;BR /&gt;
  length Sex $10;&lt;BR /&gt;
  set r CHI(in=c rename=(Statistic=Sex Prob=Age_11));&lt;BR /&gt;
  if c then Sex="p-value";&lt;BR /&gt;
run;&lt;BR /&gt;
[/pre]&lt;BR /&gt;
Sincerely,&lt;BR /&gt;
SPR

Message was edited by: SPR</description>
    <pubDate>Tue, 10 May 2011 18:19:17 GMT</pubDate>
    <dc:creator>SPR</dc:creator>
    <dc:date>2011-05-10T18:19:17Z</dc:date>
    <item>
      <title>Chi square</title>
      <link>https://communities.sas.com/t5/Statistical-Procedures/Chi-square/m-p/64307#M3051</link>
      <description>Dear all,&lt;BR /&gt;
&lt;BR /&gt;
I would like to add in a contingency table (created by proc tabulate) the corrispondence p-value: is it possible?&lt;BR /&gt;
Anyway, how can I do it?&lt;BR /&gt;
&lt;BR /&gt;
Thanks in advance &lt;BR /&gt;
Regards</description>
      <pubDate>Tue, 10 May 2011 11:56:48 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Statistical-Procedures/Chi-square/m-p/64307#M3051</guid>
      <dc:creator>L_L</dc:creator>
      <dc:date>2011-05-10T11:56:48Z</dc:date>
    </item>
    <item>
      <title>Re: Chi square</title>
      <link>https://communities.sas.com/t5/Statistical-Procedures/Chi-square/m-p/64308#M3052</link>
      <description>I don't think PROC TABULATE will do this.&lt;BR /&gt;
&lt;BR /&gt;
I believe you have to create the table in PROC FREQ and use the CHISQ option.</description>
      <pubDate>Tue, 10 May 2011 11:57:39 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Statistical-Procedures/Chi-square/m-p/64308#M3052</guid>
      <dc:creator>Paige</dc:creator>
      <dc:date>2011-05-10T11:57:39Z</dc:date>
    </item>
    <item>
      <title>Re: Chi square</title>
      <link>https://communities.sas.com/t5/Statistical-Procedures/Chi-square/m-p/64309#M3053</link>
      <description>Ok. The PROC FREQ output (with the chi square option) is &lt;BR /&gt;
1) contingency table&lt;BR /&gt;
2) Chi square test&lt;BR /&gt;
I would like to have in the contingency table the p-value, for example:&lt;BR /&gt;
            Group1        Group2        Group3 *&lt;BR /&gt;
Male      xxx             xxx              xxx&lt;BR /&gt;
             xx%             xx%           xx%&lt;BR /&gt;
Female   xxx             xxx              xxx&lt;BR /&gt;
              xx%             xx%           xx%&lt;BR /&gt;
*p=x.xxx&lt;BR /&gt;
&lt;BR /&gt;
Any ideas?&lt;BR /&gt;
thx</description>
      <pubDate>Tue, 10 May 2011 12:42:31 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Statistical-Procedures/Chi-square/m-p/64309#M3053</guid>
      <dc:creator>L_L</dc:creator>
      <dc:date>2011-05-10T12:42:31Z</dc:date>
    </item>
    <item>
      <title>Re: Chi square</title>
      <link>https://communities.sas.com/t5/Statistical-Procedures/Chi-square/m-p/64310#M3054</link>
      <description>It shouldn't be hard.&lt;BR /&gt;
&lt;BR /&gt;
proc freq data=whatever;&lt;BR /&gt;
    table gender*group/chisq;&lt;BR /&gt;
run;</description>
      <pubDate>Tue, 10 May 2011 15:14:44 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Statistical-Procedures/Chi-square/m-p/64310#M3054</guid>
      <dc:creator>Paige</dc:creator>
      <dc:date>2011-05-10T15:14:44Z</dc:date>
    </item>
    <item>
      <title>Re: Chi square</title>
      <link>https://communities.sas.com/t5/Statistical-Procedures/Chi-square/m-p/64311#M3055</link>
      <description>Thank you. Unfortunaley it's not exactly what I mean.&lt;BR /&gt;
The aim is to improve the output and to have all the information in one table.&lt;BR /&gt;
Maybe I have to use a PUT on a file and a PRINTTO...</description>
      <pubDate>Tue, 10 May 2011 17:18:23 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Statistical-Procedures/Chi-square/m-p/64311#M3055</guid>
      <dc:creator>L_L</dc:creator>
      <dc:date>2011-05-10T17:18:23Z</dc:date>
    </item>
    <item>
      <title>Re: Chi square</title>
      <link>https://communities.sas.com/t5/Statistical-Procedures/Chi-square/m-p/64312#M3056</link>
      <description>Hello L&amp;amp;L,&lt;BR /&gt;
&lt;BR /&gt;
Is this what you need?&lt;BR /&gt;
[pre]&lt;BR /&gt;
ODS output CHISQ=Chi (keep=Statistic Prob where=(Statistic="Chi-Square"));&lt;BR /&gt;
proc freq data=SASHELP.CLASS;&lt;BR /&gt;
  table sex*age/out=freq chisq;&lt;BR /&gt;
run; &lt;BR /&gt;
proc transpose data=freq out=r(drop=_:) prefix=Age_;&lt;BR /&gt;
  var percent;&lt;BR /&gt;
  id age;&lt;BR /&gt;
  by sex;&lt;BR /&gt;
run;&lt;BR /&gt;
data r;&lt;BR /&gt;
  length Sex $10;&lt;BR /&gt;
  set r CHI(in=c rename=(Statistic=Sex Prob=Age_11));&lt;BR /&gt;
  if c then Sex="p-value";&lt;BR /&gt;
run;&lt;BR /&gt;
[/pre]&lt;BR /&gt;
Sincerely,&lt;BR /&gt;
SPR

Message was edited by: SPR</description>
      <pubDate>Tue, 10 May 2011 18:19:17 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Statistical-Procedures/Chi-square/m-p/64312#M3056</guid>
      <dc:creator>SPR</dc:creator>
      <dc:date>2011-05-10T18:19:17Z</dc:date>
    </item>
    <item>
      <title>Re: Chi square</title>
      <link>https://communities.sas.com/t5/Statistical-Procedures/Chi-square/m-p/64313#M3057</link>
      <description>Yes!! Thank you so much :-))</description>
      <pubDate>Tue, 10 May 2011 20:23:32 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Statistical-Procedures/Chi-square/m-p/64313#M3057</guid>
      <dc:creator>L_L</dc:creator>
      <dc:date>2011-05-10T20:23:32Z</dc:date>
    </item>
  </channel>
</rss>

