Hello all. I'm using a poisson regression calculate age-adjusted rates and incidence rate ratios for a large dataset. I'd like to calculate age-adjusted rate for specific sub-populations. Eg. the age-adjusted rate incidence rate for current smokers. However, I do not know how to do this without stata also adjusting for smoking status. The codes I'm using at the moment are:
poisson _d i.agegrp i.smoke, exp(pyear) irr
margins, at(smoke==3) predict(ir)
I believe that in typing i.smoke, stata automatically also adjusts for smoking status. However if I do not include smoking in the regression, then stata is not able to calculate the margins for that group. Is there a way to get the value for current smokers, without adjusting for smoking status in the process of doing so?
Thank you in advance for your help!
poisson _d i.agegrp i.smoke, exp(pyear) irr
margins, at(smoke==3) predict(ir)
I believe that in typing i.smoke, stata automatically also adjusts for smoking status. However if I do not include smoking in the regression, then stata is not able to calculate the margins for that group. Is there a way to get the value for current smokers, without adjusting for smoking status in the process of doing so?
Thank you in advance for your help!
Comment