BookmarkSubscribeRSS Feed
🔒 This topic is solved and locked. Need further help from the community? Please sign in and ask a new question.
Jack2012
Obsidian | Level 7

Dear All,

 

I am trying to use PROC FREQ to calculate the Realtive risk between two groups. But when I run, I found there is one column with 0 counts for both rows. That is I have the data with n12=n22=0 counts (denoted in the manual).Therefore the PROC FREQ did not calculate any statistics for this frequency table.

 

 However, per the below manual, SAS should be able to calculate the Relative risk at least. Does anybody know how to do to make it calculate this relative risk at least? Any option to make SAS work? Or you have any good idea? many thanks.

Q1.jpg

Q1.jpg

1 ACCEPTED SOLUTION

Accepted Solutions
SteveDenham
Jade | Level 19

I think there is a typo in what you presented, or (unfortunately) you have missed @ballardw's point.

 

P2 =n21/n1 = 1, (the denominator is n1 not n2).

 

The point is that since one column is all zeroes, PROC FREQ will not calculate any statistics, including relative risk.

 

Steve Denham

View solution in original post

6 REPLIES 6
ballardw
Super User

Notice in the caluculation that p1 and p2 are defined with division by n1 and n2. Your data would have n2=0. Since division by 0 is undefined then the relative risk is undefined. i.e. Does not exist for your data.

Jack2012
Obsidian | Level 7

I am afraid I did not get your point.

P1 is n11/n1.=1; P2=n21/n2.=1;

We don't use n.2=0 at all. How do you mean that the denominator =0?

Jack2012
Obsidian | Level 7

The data in my question is as below:

How could the relative risk is not computable by SAS PROC FREQ? Not unerstand.

Question 3.jpg

SteveDenham
Jade | Level 19

I think there is a typo in what you presented, or (unfortunately) you have missed @ballardw's point.

 

P2 =n21/n1 = 1, (the denominator is n1 not n2).

 

The point is that since one column is all zeroes, PROC FREQ will not calculate any statistics, including relative risk.

 

Steve Denham

Jack2012
Obsidian | Level 7

I am afraid I can't agree with you that there was a typos. I read and wrote from the manual.

 

BUt I think the key point is that SAS set such conditioin that when once column sum is 0 then no statistics will be calculated, even they can compute. Like the Relative risk. Thanks.

StatDave
SAS Super FREQ

One additional observation here.  See this note on computing relative risks.  You can use the log-binomial approach with augmented data as shown there to get an estimate and a confidence interval for the relative risk.  

 

data a;
do g=0,1;
do i=1 to 10;
y=1; f=10000*10/100010; output;
y=0; f=1*10/100010; output;
end; end;
run;
proc genmod;
model y(event="1")=g / dist=bin link=log;
estimate 'rr' g 1 ;
run;

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 ANOVA?

ANOVA, or Analysis Of Variance, is used to compare the averages or means of two or more populations to better understand how they differ. Watch this tutorial for more.

Find more tutorials on the SAS Users YouTube channel.

Discussion stats
  • 6 replies
  • 2395 views
  • 2 likes
  • 4 in conversation