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

Hi,

I try to use proc genmod to estimate two risk ratios because the predictor of smokes has three levels (never, current, and former smokers). Would you please tell me how to do that? Here is the SAS syntax I made. Thank you in advance.

 

proc genmod ;
class seqn smokes /param=ref ref=first;
model lung_cancer=smokes /dist=poi link=log;
repeated subject=seqn;
run;

1 ACCEPTED SOLUTION

Accepted Solutions
StatDave
SAS Super FREQ

See this note on estimating risk ratios (relative risks). As shown there, you can use PROC LOGISTIC with LSMEANS followed by the NLMeans macro or PROC GENMOD, again with an LSMEANS statement. Since the latter seems to be the approach you are taking, you just need to add an LSMEANS statement with the DIFF, EXP, and CL options (assuming you want confidence intervals). The LSMEANS statement will handle however many levels are in the predictor. But you will need to change PARAM=REF to PARAM=GLM to use the LSMEANS statement.

View solution in original post

2 REPLIES 2
StatDave
SAS Super FREQ

See this note on estimating risk ratios (relative risks). As shown there, you can use PROC LOGISTIC with LSMEANS followed by the NLMeans macro or PROC GENMOD, again with an LSMEANS statement. Since the latter seems to be the approach you are taking, you just need to add an LSMEANS statement with the DIFF, EXP, and CL options (assuming you want confidence intervals). The LSMEANS statement will handle however many levels are in the predictor. But you will need to change PARAM=REF to PARAM=GLM to use the LSMEANS statement.

hongjie76
Calcite | Level 5
Many thanks. It works. Hongjie

SAS Innovate 2025: Save the Date

 SAS Innovate 2025 is scheduled for May 6-9 in Orlando, FL. Sign up to be first to learn about the agenda and registration!

Save the date!

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
  • 676 views
  • 1 like
  • 2 in conversation