BookmarkSubscribeRSS Feed
LarissaW
Obsidian | Level 7

Hi, I'm trying to calculate relative risk (RR) for a cohort study using proc genmod. I'm confused about the difference between the estimate and contrast statement and what the 1 / 0 wrote after the variable in the estimate/contrast statement. 

This is my class level of the independent variable (I set 'age1=2' as the reference and I want to calculate the RR of other age1 groups vs 'age1=2', respectively):

Screenshot 2023-06-16 120539.png

and this is the code I use now (I reviewed some instructions but I don't really understand the meaning of the numbers like '1 0 0 0', and '0 0 1 0' after age1 in the estimate row, like what they represent? how do we know what number I should put in here?" :

proc genmod data=liverf desc;
class age1 (ref='2') / param=ref;
model caseco(ref='0') = age1 / dist=bin link=log;
estimate "Age1 vs Age2" age1 1 0 0 0 /exp;
estimate "Age3 vs Age2" age1 0 1 0 0 / exp;
estimate "Age4 vs Age2" age1 0 0 1 0 / exp;
estimate "Age5 vs Age2" age1 0 0 0 1 / exp;
run;

This is the output of the codes (Is the mean estimate the calculated relative risk, and the mean CI is the CI corresponding to the RR?)

12.png

If anyone can explain and clarify these, I would really appreciate it.

2 REPLIES 2
StatDave
SAS Super FREQ

You should always avoid using the CONTRAST or ESTIMATE statement when simpler statements like LSMEANS, LSMESTIMATE, or SLICE can be used. In this case, you can drop the ESTIMATE statements and replace them with a single LSMEANS statement:

lsmeans age1 / diff cl exp;

The Exponentiated columns in the LSMEANS table are the estimated event probabilities and in the Differences table they give the relative risk estimates. 

sas-innovate-2024.png

Available on demand!

Missed SAS Innovate Las Vegas? Watch all the action for free! View the keynotes, general sessions and 22 breakouts on demand.

 

Register now!

What is ANOVA?

ANOVA, or Analysis Of Variance, is used to compare the averages or means of two or more populations to better understand how they differ. Watch this tutorial for more.

Find more tutorials on the SAS Users YouTube channel.

Discussion stats
  • 2 replies
  • 620 views
  • 2 likes
  • 3 in conversation