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

Hi,

 

I have a data that looks as follows and I want to compute incidence rate.

 

ID     events     person-days     exposure

1         2               80                   0 

2         0               11                   1

3         11             60                   1

4        19              30                   0

 

where events is the dependent variable and exposure is the disease status which is dependent and person days is the total person days contributed by each individual/id. I am using proc genmod for this and want to understand the code. I understand that I have to consider the distribution poisson/poisson-nb, zero inflated. following is the code.

 

proc genmode data= mydata;

class exposure;

model event= exposure/offset=logpersondays dist=poisson

link=log type3;

run;

 

Can someone please comment if I have the variables in correct order? Also will this code also give me the crude incidence rates?

Will appreciate any suggestions.

 

 

 

 

 

 

 

 

I am using proc genmod and want to understand the code 

1 ACCEPTED SOLUTION

Accepted Solutions
StatDave
SAS Super FREQ

The code looks fine. GENMOD is a general modeling procedure, so it doesn't provide specialized summary statistics like the crude rates. But you can easily get those with simple calculations:

 

proc means nway data=a;
class exposure;
var events persondays;
output out=out sum=sumevents sumdays;
run;
data crude;
set out;
obsrate=sumevents/sumdays;
run;
proc print;
run;

View solution in original post

2 REPLIES 2
StatDave
SAS Super FREQ

The code looks fine. GENMOD is a general modeling procedure, so it doesn't provide specialized summary statistics like the crude rates. But you can easily get those with simple calculations:

 

proc means nway data=a;
class exposure;
var events persondays;
output out=out sum=sumevents sumdays;
run;
data crude;
set out;
obsrate=sumevents/sumdays;
run;
proc print;
run;

GreenTree1
Obsidian | Level 7

Awesome, I ran this and got the crude rates that I had calculated using a long convoluted code, being a new SAS user :). This one is so much more efficient.

 

I am now interested in knowing if my results are significant.  I think we are already discussing this in another post started by me that you have answered, and I will keep an eye on that one. 

 

For those who are following this, here is the link to the other post

 

https://communities.sas.com/t5/Statistical-Procedures/how-to-compute-Incidence-rate-and-incidence-ra...

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