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
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;
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;
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
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!
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.