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: Save the Date

 SAS Innovate 2025 is scheduled for May 6-9 in Orlando, FL. Sign up to be first to learn about the agenda and registration!

Save the date!

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