turn on suggestions

Auto-suggest helps you quickly narrow down your search results by suggesting possible matches as you type.

Showing results for

Find a Community

- Home
- /
- SAS Programming
- /
- SAS Procedures
- /
- exact p-value for one-sided test in Proc Freq

Topic Options

- Subscribe to RSS Feed
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Bookmark
- Subscribe
- Printer Friendly Page

- Mark as New
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Highlight
- Email to a Friend
- Report Inappropriate Content

02-14-2011 05:20 PM

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?

Here's my code:

Data table;

input n onset hatch;

*where onset=1 for early and hatch=1 for asynchronous;

datalines;

1 1 0

6 1 1

8 0 0

6 0 1

;

proc freq data=table;

weight n;

tables onset*hatch / chisq;

exact lrchi;

run;

and here's the output:

The FREQ Procedure

Statistics for Table of onset by hatch

Likelihood Ratio Chi-Square Test

Chi-Square 3.8191

DF 1

Asymptotic Pr > ChiSq 0.0507

Exact Pr >= ChiSq 0.0873

Fisher's Exact Test

Cell (1,1) Frequency (F) 8

Left-sided Pr <= F 0.9932

Right-sided Pr >= F 0.0783

Table Probability (P) 0.0715

Two-sided Pr <= P 0.1588

Here's my code:

Data table;

input n onset hatch;

*where onset=1 for early and hatch=1 for asynchronous;

datalines;

1 1 0

6 1 1

8 0 0

6 0 1

;

proc freq data=table;

weight n;

tables onset*hatch / chisq;

exact lrchi;

run;

and here's the output:

The FREQ Procedure

Statistics for Table of onset by hatch

Likelihood Ratio Chi-Square Test

Chi-Square 3.8191

DF 1

Asymptotic Pr > ChiSq 0.0507

Exact Pr >= ChiSq 0.0873

Fisher's Exact Test

Cell (1,1) Frequency (F) 8

Left-sided Pr <= F 0.9932

Right-sided Pr >= F 0.0783

Table Probability (P) 0.0715

Two-sided Pr <= P 0.1588