Hello! I'm trying to get the incidence rates adjusting for multiple covariates and stratified by sex and age.
This is what my data looks like:
case person-time age sex smoke alcohol urban
0 2 18 1 0 1 0
1 7 19 2 1 0 1
1 4 20 1 0 1 1
To get the unadjusted, I was interested in incidence of cases/total person-time by age and sex, and I was able to do a proc sql to get the numerator and denominator file and got distinct cases/total person time.
*numerator file*;
proc sql ;
Create table numerator as
select distinct sum(cases) as cases,
sex,
age
from filename
where cases=1
group by age, sex;
quit;
*to create my denominator*
proc sql ;
Create table denominator as
select distinct sum(persontime) as pt,
sex,
age
from filename
group by age, sex;
quit;
I then modeled it using a Poisson distribution to get the Incidence rates confidence intervals.
proc genmod data=g.filename; class age sex; model cases=age sex / offset=logpyr dist=nb link=log type3; lsmeans age sex/ilink cl diff means; store out=insmodel; run;
*proc plm*; proc plm source=insmodel; score data=filename out=inspred pred stderr lclm uclm/nooffset ilink; run; proc print label; id cases total; run;
However, when I try do the adjusted model, where I adjust for smoke, alcohol, sex and age, I get multiple rates for all the possible combinations of the variables I'm trying to adjust for. I've tried using this sas note but it's note giving me the ouput I want.
... View more