<?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 exact p-value for one-sided test in Proc Freq in SAS Procedures</title>
    <link>https://communities.sas.com/t5/SAS-Procedures/exact-p-value-for-one-sided-test-in-Proc-Freq/m-p/9783#M773</link>
    <description>I have a 2 x 2 table of binary variables. The sample size is only 21, so I want to get an exact p-value for the likelihood-ratio chi-square. While Fisher's Exact Test provides p values for one-sided tests, there doesn't seem to be an option for getting exact p values for one-sided likelihood ratio chi-square tests. Does anyone know if this is available in PROC FREQ, or do I need to use another procedure?&lt;BR /&gt;
&lt;BR /&gt;
Here's my code: &lt;BR /&gt;
&lt;BR /&gt;
Data table;&lt;BR /&gt;
input n onset hatch; &lt;BR /&gt;
*where onset=1 for early and hatch=1 for asynchronous;&lt;BR /&gt;
datalines;&lt;BR /&gt;
1 1 0&lt;BR /&gt;
6 1 1&lt;BR /&gt;
8 0 0&lt;BR /&gt;
6 0 1&lt;BR /&gt;
;&lt;BR /&gt;
&lt;BR /&gt;
proc freq data=table;&lt;BR /&gt;
weight n;&lt;BR /&gt;
tables onset*hatch / chisq;&lt;BR /&gt;
exact lrchi; &lt;BR /&gt;
run;&lt;BR /&gt;
&lt;BR /&gt;
and here's the output:&lt;BR /&gt;
&lt;BR /&gt;
   The FREQ Procedure                                                  &lt;BR /&gt;
                                  Statistics for Table of onset by hatch                                        &lt;BR /&gt;
                                                                                                                      &lt;BR /&gt;
                                           Likelihood Ratio Chi-Square Test                                           &lt;BR /&gt;
                                  &lt;BR /&gt;
                                          Chi-Square                  3.8191                                          &lt;BR /&gt;
                                          DF                               1                                          &lt;BR /&gt;
                                          Asymptotic Pr &amp;gt;  ChiSq      0.0507                                          &lt;BR /&gt;
                                          Exact      Pr &amp;gt;= ChiSq      0.0873                                          &lt;BR /&gt;
                                                                                                                                           &lt;BR /&gt;
                                                 Fisher's Exact Test                                                  &lt;BR /&gt;
                                                                  &lt;BR /&gt;
                                          Cell (1,1) Frequency (F)         8                                          &lt;BR /&gt;
                                          Left-sided Pr &amp;lt;= F          0.9932                                          &lt;BR /&gt;
                                          Right-sided Pr &amp;gt;= F         0.0783                                          &lt;BR /&gt;
                                                                                                                      &lt;BR /&gt;
                                          Table Probability (P)       0.0715                                          &lt;BR /&gt;
                                          Two-sided Pr &amp;lt;= P           0.1588</description>
    <pubDate>Mon, 14 Feb 2011 22:20:42 GMT</pubDate>
    <dc:creator>JWang</dc:creator>
    <dc:date>2011-02-14T22:20:42Z</dc:date>
    <item>
      <title>exact p-value for one-sided test in Proc Freq</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/exact-p-value-for-one-sided-test-in-Proc-Freq/m-p/9783#M773</link>
      <description>I have a 2 x 2 table of binary variables. The sample size is only 21, so I want to get an exact p-value for the likelihood-ratio chi-square. While Fisher's Exact Test provides p values for one-sided tests, there doesn't seem to be an option for getting exact p values for one-sided likelihood ratio chi-square tests. Does anyone know if this is available in PROC FREQ, or do I need to use another procedure?&lt;BR /&gt;
&lt;BR /&gt;
Here's my code: &lt;BR /&gt;
&lt;BR /&gt;
Data table;&lt;BR /&gt;
input n onset hatch; &lt;BR /&gt;
*where onset=1 for early and hatch=1 for asynchronous;&lt;BR /&gt;
datalines;&lt;BR /&gt;
1 1 0&lt;BR /&gt;
6 1 1&lt;BR /&gt;
8 0 0&lt;BR /&gt;
6 0 1&lt;BR /&gt;
;&lt;BR /&gt;
&lt;BR /&gt;
proc freq data=table;&lt;BR /&gt;
weight n;&lt;BR /&gt;
tables onset*hatch / chisq;&lt;BR /&gt;
exact lrchi; &lt;BR /&gt;
run;&lt;BR /&gt;
&lt;BR /&gt;
and here's the output:&lt;BR /&gt;
&lt;BR /&gt;
   The FREQ Procedure                                                  &lt;BR /&gt;
                                  Statistics for Table of onset by hatch                                        &lt;BR /&gt;
                                                                                                                      &lt;BR /&gt;
                                           Likelihood Ratio Chi-Square Test                                           &lt;BR /&gt;
                                  &lt;BR /&gt;
                                          Chi-Square                  3.8191                                          &lt;BR /&gt;
                                          DF                               1                                          &lt;BR /&gt;
                                          Asymptotic Pr &amp;gt;  ChiSq      0.0507                                          &lt;BR /&gt;
                                          Exact      Pr &amp;gt;= ChiSq      0.0873                                          &lt;BR /&gt;
                                                                                                                                           &lt;BR /&gt;
                                                 Fisher's Exact Test                                                  &lt;BR /&gt;
                                                                  &lt;BR /&gt;
                                          Cell (1,1) Frequency (F)         8                                          &lt;BR /&gt;
                                          Left-sided Pr &amp;lt;= F          0.9932                                          &lt;BR /&gt;
                                          Right-sided Pr &amp;gt;= F         0.0783                                          &lt;BR /&gt;
                                                                                                                      &lt;BR /&gt;
                                          Table Probability (P)       0.0715                                          &lt;BR /&gt;
                                          Two-sided Pr &amp;lt;= P           0.1588</description>
      <pubDate>Mon, 14 Feb 2011 22:20:42 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/exact-p-value-for-one-sided-test-in-Proc-Freq/m-p/9783#M773</guid>
      <dc:creator>JWang</dc:creator>
      <dc:date>2011-02-14T22:20:42Z</dc:date>
    </item>
  </channel>
</rss>

