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

Hi All!!!

 

I need to compute the relative risk for a 2x5 table, having the lowest group as the reference value.

Can anybody help me?

Thank you in advance

 

 

Antonio

1 ACCEPTED SOLUTION

Accepted Solutions
Ksharp
Super User
/*
Relative Rick is only calculated for 2x2 tables.
2xK table I think you mean multiple 2x2 tables,
*/
data have;
call streaminit(123);
do page=1 to 20;
 do obs=1 to 100;
  row=rand('bern',0.4);
  col=rand('bern',0.6);
  output;
 end;
end;
run;


proc freq data=have;
table page*row*col/relrisk(column=1)  ;
run;

View solution in original post

4 REPLIES 4
Ksharp
Super User
/*
Relative Rick is only calculated for 2x2 tables.
2xK table I think you mean multiple 2x2 tables,
*/
data have;
call streaminit(123);
do page=1 to 20;
 do obs=1 to 100;
  row=rand('bern',0.4);
  col=rand('bern',0.6);
  output;
 end;
end;
run;


proc freq data=have;
table page*row*col/relrisk(column=1)  ;
run;
antor82
Obsidian | Level 7

Thank You very much Ksharp for Your prompt and clear reply!

 

Actually I have a binary outcome (0/1) and a categorical predictor with four mutually exclusive values (0/1/2/3).

When a run a proc freq, I obtain a 2x4 table.

Should I create different columns for each of the four values of the predictor variable?

Then should I run a proc freq as in Your example?

eg:

table outcome*pred1*pred2*pred3*pred4

?

 

Thank You in advance

antor82
Obsidian | Level 7

trying to be clearer...

 

Binary outcome 0/1

Four class of renal damage A/B/C/D

 

I need to compute the RR for the outcome "1" in B vs A; C vs A; D vs A.

 

Hope is clearer now.

Similar to a proc logistic with A as the reference value. Only needing to compute RR instead of OR

Ksharp
Super User
"I need to compute the RR for the outcome "1" in B vs A; C vs A; D vs A."
Then you need make three sas datasets(2x2 table) for RR separatedly .
And @StatDave posted a very useful URL, check it out:
https://support.sas.com/kb/23/003.html

SAS Innovate 2025: Call for Content

Are you ready for the spotlight? We're accepting content ideas for SAS Innovate 2025 to be held May 6-9 in Orlando, FL. The call is open until September 25. Read more here about why you should contribute and what is in it for you!

Submit your idea!

How to Concatenate Values

Learn how use the CAT functions in SAS to join values from multiple variables into a single value.

Find more tutorials on the SAS Users YouTube channel.

Click image to register for webinarClick image to register for webinar

Classroom Training Available!

Select SAS Training centers are offering in-person courses. View upcoming courses for:

View all other training opportunities.

Discussion stats
  • 4 replies
  • 668 views
  • 0 likes
  • 2 in conversation