## How to make PROC FREQ can calculate the Relative Risk for the column with 0 counts in a column?

Solved
Frequent Contributor
Posts: 88

# How to make PROC FREQ can calculate the Relative Risk for the column with 0 counts in a column?

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.

Accepted Solutions
Solution
‎09-08-2016 08:59 AM
Posts: 2,655

## Re: How to make PROC FREQ can calculate the Relative Risk for the column with 0 counts in a column?

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

All Replies
Super User
Posts: 11,813

## Re: How to make PROC FREQ can calculate the Relative Risk for the column with 0 counts in a column?

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.

Frequent Contributor
Posts: 88

## Re: How to make PROC FREQ can calculate the Relative Risk for the column with 0 counts in a column?

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?

Frequent Contributor
Posts: 88

## Re: How to make PROC FREQ can calculate the Relative Risk for the column with 0 counts in a column?

The data in my question is as below:

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

Solution
‎09-08-2016 08:59 AM
Posts: 2,655

## Re: How to make PROC FREQ can calculate the Relative Risk for the column with 0 counts in a column?

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

Frequent Contributor
Posts: 88

## Re: How to make PROC FREQ can calculate the Relative Risk for the column with 0 counts in a column?

Posted in reply to SteveDenham

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.

SAS Employee
Posts: 309

## Re: How to make PROC FREQ can calculate the Relative Risk for the column with 0 counts in a column?

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;

☑ This topic is solved.

Need further help from the community? Please ask a new question.

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