turn on suggestions

Auto-suggest helps you quickly narrow down your search results by suggesting possible matches as you type.

Showing results for

Find a Community

- Home
- /
- Analytics
- /
- Stat Procs
- /
- How to make PROC FREQ can calculate the Relative R...

Topic Options

- Subscribe to RSS Feed
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Bookmark
- Subscribe
- Printer Friendly Page

- Mark as New
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Highlight
- Email to a Friend
- Report Inappropriate Content

08-26-2016 11:21 AM

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

- Mark as New
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Highlight
- Email to a Friend
- Report Inappropriate Content

08-31-2016 07:42 AM

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

- Mark as New
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Highlight
- Email to a Friend
- Report Inappropriate Content

08-26-2016 12:34 PM

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.

- Mark as New
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Highlight
- Email to a Friend
- Report Inappropriate Content

08-28-2016 10:09 PM

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?

- Mark as New
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Highlight
- Email to a Friend
- Report Inappropriate Content

08-28-2016 10:13 PM

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

- Mark as New
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Highlight
- Email to a Friend
- Report Inappropriate Content

08-31-2016 07:42 AM

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

- Mark as New
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Highlight
- Email to a Friend
- Report Inappropriate Content

09-08-2016 08:59 AM

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.

- Mark as New
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Highlight
- Email to a Friend
- Report Inappropriate Content

09-09-2016 04:09 PM

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;