<?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 Obtain Pvalue in SAS Procedures</title>
    <link>https://communities.sas.com/t5/SAS-Procedures/Obtain-Pvalue/m-p/808463#M81766</link>
    <description>&lt;P&gt;Hello everyone,&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I was trying to obtain pvalue using proc freq. But, looks like there are no cross tabulations. Is there any other alternative to obtain the p-values for these variable?&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;proc freq data = test2;
2082       	tables non_femaleacademicprod * male_parent_aca_pro/ chisq;
2083       	ods output ChiSq = chsq9(where=(Statistic = "Mantel-Haenszel
2083     ! Chi-Square"));
2084       run;

WARNING: Output 'ChiSq' was not created.  Make sure that the output object 
         name, label, or path is spelled correctly.  Also, verify that the 
         appropriate procedure options are used to produce the requested output 
         object.  For example, verify that the NOPRINT option is not used.&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;Thanks!&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Tue, 19 Apr 2022 01:29:09 GMT</pubDate>
    <dc:creator>RAVI2000</dc:creator>
    <dc:date>2022-04-19T01:29:09Z</dc:date>
    <item>
      <title>Obtain Pvalue</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/Obtain-Pvalue/m-p/808463#M81766</link>
      <description>&lt;P&gt;Hello everyone,&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I was trying to obtain pvalue using proc freq. But, looks like there are no cross tabulations. Is there any other alternative to obtain the p-values for these variable?&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;proc freq data = test2;
2082       	tables non_femaleacademicprod * male_parent_aca_pro/ chisq;
2083       	ods output ChiSq = chsq9(where=(Statistic = "Mantel-Haenszel
2083     ! Chi-Square"));
2084       run;

WARNING: Output 'ChiSq' was not created.  Make sure that the output object 
         name, label, or path is spelled correctly.  Also, verify that the 
         appropriate procedure options are used to produce the requested output 
         object.  For example, verify that the NOPRINT option is not used.&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;Thanks!&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 19 Apr 2022 01:29:09 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/Obtain-Pvalue/m-p/808463#M81766</guid>
      <dc:creator>RAVI2000</dc:creator>
      <dc:date>2022-04-19T01:29:09Z</dc:date>
    </item>
    <item>
      <title>Re: Obtain Pvalue</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/Obtain-Pvalue/m-p/808465#M81767</link>
      <description>Those both variable used in tables statement are ordinal.&lt;BR /&gt;&lt;BR /&gt;1- Large -ve impact&lt;BR /&gt;2- Small -ve impact&lt;BR /&gt;3- No impact&lt;BR /&gt;4- Large + impact&lt;BR /&gt;5- Small +ve impact</description>
      <pubDate>Tue, 19 Apr 2022 02:10:25 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/Obtain-Pvalue/m-p/808465#M81767</guid>
      <dc:creator>RAVI2000</dc:creator>
      <dc:date>2022-04-19T02:10:25Z</dc:date>
    </item>
    <item>
      <title>Re: Obtain Pvalue</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/Obtain-Pvalue/m-p/808519#M81768</link>
      <description>&lt;P&gt;Here is some code that works. I used a WEIGHT variable so that I would not need to type some many rows of data. I also used 4 categories instead of 5.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;data Test2;
input non_femaleacademicprod male_parent_aca_pro Count;
datalines;
1 1 27
1 2 13
1 3 23
1 4 33
2 1 37
2 2 23
2 3 13
2 4 15
3 1 14
3 2  9
3 3  5
3 4  7
4 1 14
4 2  9
4 3  5
4 4 12
;

ods trace on;
proc freq data = test2;
weight Count;
tables non_femaleacademicprod * male_parent_aca_pro/ chisq;
ods output ChiSq = chsq9(where=(Statistic="Mantel-Haenszel Chi-Square"));
run;&lt;BR /&gt;&lt;BR /&gt;proc print data=Chsq9;&lt;BR /&gt;run;&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;Since my code works and yours does not, I suspect you might have a typo in the WHERE clause. First, output the entire data set of statistics by using&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;STRONG&gt;ods output ChiSq = chsq9;&lt;/STRONG&gt;&lt;/P&gt;
&lt;P&gt;Do you see the data? If so, it is your WHERE clause that is incorrect. Make sure there are no extra spaces. If necessary, use a simpler WHERE clause such as&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;STRONG&gt;ods output ChiSq = chsq9(where=(Statistic contains "Mantel"));&lt;/STRONG&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 19 Apr 2022 10:47:17 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/Obtain-Pvalue/m-p/808519#M81768</guid>
      <dc:creator>Rick_SAS</dc:creator>
      <dc:date>2022-04-19T10:47:17Z</dc:date>
    </item>
    <item>
      <title>Re: Obtain Pvalue</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/Obtain-Pvalue/m-p/808574#M81771</link>
      <description>&lt;P&gt;Did you include the ENTIRE log for that Proc Freq?&lt;/P&gt;
&lt;P&gt;I know that I can create the same warning with a data set that only has one level of a variable on the Tables statement but that shows a note about that as well.&lt;/P&gt;</description>
      <pubDate>Tue, 19 Apr 2022 14:54:49 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/Obtain-Pvalue/m-p/808574#M81771</guid>
      <dc:creator>ballardw</dc:creator>
      <dc:date>2022-04-19T14:54:49Z</dc:date>
    </item>
    <item>
      <title>Re: Obtain Pvalue</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/Obtain-Pvalue/m-p/809167#M81774</link>
      <description>&lt;P&gt;My data was not cleaned properly thus giving the error.&lt;/P&gt;</description>
      <pubDate>Thu, 21 Apr 2022 20:41:17 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/Obtain-Pvalue/m-p/809167#M81774</guid>
      <dc:creator>RAVI2000</dc:creator>
      <dc:date>2022-04-21T20:41:17Z</dc:date>
    </item>
  </channel>
</rss>

