Statistical Procedures

Programming the statistical procedures from SAS
BookmarkSubscribeRSS Feed
☑ This topic is solved. Need further help from the community? Please sign in and ask a new question.
yubaraj
Fluorite | Level 6

I have a binary outcome variable and covariates with multiple categories.

I am trying to estimate adjusted risk ratios and confidence intervals. 

I reviewed previous discussions in SAS  forum about this topic

https://communities.sas.com/t5/Statistical-Procedures/How-to-get-categorical-variables-RR-estimates-...

 https://communities.sas.com/t5/Statistical-Procedures/RR-estimates-using-proc-Genmod-for-categorical

https://academic.oup.com/aje/article/162/3/199/171116

345-2011: Using SAS® Procedures FREQ, GENMOD, LOGISTIC, and PHREG to Estimate Adjusted Relative Risk...

 

but these don't help when I have a covariate with multiple categories because the output it produces are not meaningful for multiple category.

It works well when I use lsmeans option

 

proc genmod data =xyz;
class id  x (ref = "5")  y (ref = "M")  z(ref = "Q1")  / param =glm;
model one_dose (event='1') = x y z/ dist = binomial  link = log;

lsmeans x y z / diff exp cl;

run;

 

but I want to use modified Poisson because prevalence of outcome is high. over 50% as a very similar study as mine used modified poisson regression.

https://www.thelancet.com/action/showPdf?pii=S2468-2667%2822%2900037-8

 

 

My code is as follows;

 

proc genmod data =xyz;
class id  x (ref = "5")  y (ref = "M")  z(ref = "Q1")  / param =ref;
model one_dose (event='1') = x y z/ dist = poisson link = log;
repeated subject = id/ type = unstr;
Estimate "RR x"  x  1/exp;
Estimate "RR y" y  1/exp;
Estimate "RR z" z 1/exp;
run;

So, basically, my question is how do we write the "estimate" statements when the covariate has multiple categories and how to assign a reference category in a modified Poisson model. 

 

Thanks a lot

Yuba 

1 ACCEPTED SOLUTION

Accepted Solutions
StatDave
SAS Super FREQ

Is there some reason that you feel you can't use the same LSMEANS statement in your second set of code like you did you your first set of code? See the Modified Poisson section of this note

View solution in original post

3 REPLIES 3
StatDave
SAS Super FREQ

Is there some reason that you feel you can't use the same LSMEANS statement in your second set of code like you did you your first set of code? See the Modified Poisson section of this note

yubaraj
Fluorite | Level 6

Great @StatDave 

This modification works; I initially wrote param=ref, however, param=glm works as you mentioned in one of the  previous posts.

 

proc genmod data =xyz;
class id  x (ref = "5")  y (ref = "M")  z(ref = "Q1")  / param =glm;
model one_dose (event='1') = x y z/ dist = poisson link = log;
repeated subject = id/ type = unstr;

lsmeans x y z/ diff exp cl;

run;

Any idea how to assign a reference category, because it does not show results for first category as a reference category. 

StatDave
SAS Super FREQ
I don't know what you mean - LSMEANS gives an estimate for each level of the specified variable(s) and the DIFF option gives all of the pairwise differences. What and where exactly is the problem with respect to a reference level?

sas-innovate-white.png

Our biggest data and AI event of the year.

Don’t miss the livestream kicking off May 7. It’s free. It’s easy. And it’s the best seat in the house.

Join us virtually with our complimentary SAS Innovate Digital Pass. Watch live or on-demand in multiple languages, with translations available to help you get the most out of every session.

 

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
  • 3 replies
  • 1688 views
  • 0 likes
  • 2 in conversation