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

sas-innovate-2024.png

Join us for SAS Innovate April 16-19 at the Aria in Las Vegas. Bring the team and save big with our group pricing for a limited time only.

Pre-conference courses and tutorials are filling up fast and are always a sellout. Register today to reserve your seat.

 

Register now!

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.

Click image to register for webinarClick image to register for webinar

Classroom Training Available!

Select SAS Training centers are offering in-person courses. View upcoming courses for:

View all other training opportunities.

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