BookmarkSubscribeRSS Feed
JWang
Calcite | Level 5
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

hackathon24-white-horiz.png

The 2025 SAS Hackathon Kicks Off on June 11!

Watch the live Hackathon Kickoff to get all the essential information about the SAS Hackathon—including how to join, how to participate, and expert tips for success.

YouTube LinkedIn

What is Bayesian Analysis?

Learn the difference between classical and Bayesian statistical approaches and see a few PROC examples to perform Bayesian analysis in this video.

Find more tutorials on the SAS Users YouTube channel.

SAS Training: Just a Click Away

 Ready to level-up your skills? Choose your own adventure.

Browse our catalog!

Discussion stats
  • 0 replies
  • 2773 views
  • 0 likes
  • 1 in conversation