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

hackathon24-white-horiz.png

The 2025 SAS Hackathon has begun!

It's finally time to hack! Remember to visit the SAS Hacker's Hub regularly for news and updates.

Latest Updates

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.

SAS Training: Just a Click Away

 Ready to level-up your skills? Choose your own adventure.

Browse our catalog!

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