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

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