BookmarkSubscribeRSS Feed
Lorraine22
Obsidian | Level 7

Hi

 

can i get confidence intervals for each cell in a "r x c table" (based on row percent)

 

I have used the riskfdiff option in a 2x2 table ; but obviously this does not work on 3x2 table

 

data 2x2;
input Shop $ Low Total;

Outcome="2.High"; Count=Total-Low ; output;
Outcome="1.Low"; Count=Low ; output;


datalines;
Shop1 7000 15275
Shop2 2500 7500
;

proc print data=2x2;
var Shop Outcome Count;
run;

proc freq data=2x2 order=formatted;
weight Count;
table Shop * Outcome / nopercent nocol chisq riskdiff;

run;

 

 

/******************/

 

data 3x2;
input Shop $ Low Total;

Outcome="2.High"; Count=Total-Low ; output;
Outcome="1.Low"; Count=Low ; output;

 

datalines;
Shop1 7000 15275
Shop2 2500 7500

Shop3 1850 5250
;

proc print data=3x2;
var Shop Outcome Count;
run;

proc freq data=3x2order=formatted;
weight Count;
table Shop * Outcome / nopercent nocol chisq ;

run;

 

I've worked it out using an online calculator but can;t replicate in SAS - i would really appreciate any guidance 

 

many thanks

L

 

 

2 REPLIES 2
PaigeMiller
Diamond | Level 26

As far as I know, you can only get confidence intervals of the percent in each cell using PROC FREQ if you have a one-way table.

 

So, you could probably turn your rxc table into a one-way table with rxc categories, and get the confidence intervals that way.

--
Paige Miller
Lorraine22
Obsidian | Level 7

thanks for the reply Paige - I will look into your suggestion

 

best wishes

Lorraine

SAS Innovate 2025: Call for Content

Are you ready for the spotlight? We're accepting content ideas for SAS Innovate 2025 to be held May 6-9 in Orlando, FL. The call is open until September 16. Read more here about why you should contribute and what is in it for you!

Submit your idea!

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
  • 2 replies
  • 822 views
  • 0 likes
  • 2 in conversation