- Mark as New
- Bookmark
- Subscribe
- Mute
- RSS Feed
- Permalink
- Report Inappropriate Content
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
- Mark as New
- Bookmark
- Subscribe
- Mute
- RSS Feed
- Permalink
- Report Inappropriate Content
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
- Mute
- RSS Feed
- Permalink
- Report Inappropriate Content
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
- Mute
- RSS Feed
- Permalink
- Report Inappropriate Content
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
- Mute
- RSS Feed
- Permalink
- Report Inappropriate Content
The data in my question is as below:
How could the relative risk is not computable by SAS PROC FREQ? Not unerstand.
- Mark as New
- Bookmark
- Subscribe
- Mute
- RSS Feed
- Permalink
- Report Inappropriate Content
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
- Mute
- RSS Feed
- Permalink
- Report Inappropriate Content
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
- Mute
- RSS Feed
- Permalink
- Report Inappropriate Content
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;