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

Hello!

 

I'm having a bit of trouble getting RR from a Poisson model using count data and with interaction terms. I have data like this:

 

data x;

count   time     intervention   status  totalcount;

12         1            1                   0          21

34         2            0                   0          40

12         3            0                   1          20

15         4            1                   1          20

16         5            0                    1         21

run;

*Note: Count is number of patients hospitalized, and total count is total patients.*

 

I'm interested in knowing how the intervention affected the count, and also how it differed by status so I ran this model.

proc genmod data=x;
class status intervention/param=glm;
model count= time intervention status status*intervention intervention*time/dist=poisson offset=log_tc;
run;

*log_tc*= I took the log of the total count*

I get the coefficients from this output but I want to be able to interpret my output in terms of risk ratios/rate ratios.

 

However, using the estimate statements/LSMeans does not exactly work in this situation and I'm not sure what to do to get it since I have interaction terms in my model.


If I had just main effect terms in the model, I would take the exponents of the coefficients, but with interaction terms how would I get the estimates? and interpret all of them, including the interactions?

 

For instance I want to know how the count varied by status (=1) where intervention=1. 

 

I would appreciate any guidance on this!

1 ACCEPTED SOLUTION

Accepted Solutions
StatDave
SAS Super FREQ

Your response is apparently binary and then aggregated, resulting in a count of events out of a total count of trials. As such you can simply fit a logistic model using "events/trials" syntax for specifying the observed counts. You can then obtain the risk ratio (relative risk) using the NLMEANS macro as discussed and illustrated in this note

View solution in original post

3 REPLIES 3
StatDave
SAS Super FREQ

Your response is apparently binary and then aggregated, resulting in a count of events out of a total count of trials. As such you can simply fit a logistic model using "events/trials" syntax for specifying the observed counts. You can then obtain the risk ratio (relative risk) using the NLMEANS macro as discussed and illustrated in this note

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!

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
  • 823 views
  • 4 likes
  • 3 in conversation