Thanks in advance for any help. Stata 14.2.
I am looking at the effect of predictors (age, sex, race, blood glucose, etc.) for the outcome of insulin use (binary, non-recurrent).
Some of the predictors (like glucose) are time-varying.
I have data in long format, organized by year, for 10 years of follow-up. Data example:
etc.
My primary analysis is a cox model. However, I now want to evaluate absolute incidence rates, and additive interactions.
I decided to do this with a poisson model that is trying to recapitulate the cox model as closely as possible. example code:
poisson insulin_use ibn.year age sex glucose white_race, irr
this works nicely, but now I would like to use this model to predict the absolute incidence rates in strata of predictors, adjusted for other predictors.
For example, I would like to say that the predicted incidence rate for females, adjusted for age, glucose, and race, is 5.6 events / 100 person years.
Then I would like to look at interactions with race, etc.
I have seen folks use the marginal command for this sort of thing, but not using data in the long format like this, and i'm wondering exactly how to set it up to give correct absolute incidence rate estimates.
Thanks for any guidance.
I am looking at the effect of predictors (age, sex, race, blood glucose, etc.) for the outcome of insulin use (binary, non-recurrent).
Some of the predictors (like glucose) are time-varying.
I have data in long format, organized by year, for 10 years of follow-up. Data example:
ID | year | insulin_use | age | sex | glucose | white_race |
1 | 0 | 0 | 45 | 1 | 103 | 0 |
1 | 1 | 0 | 45 | 1 | 184 | 0 |
1 | 2 | 1 | 45 | 1 | 172 | 0 |
1 | 3 | 1 | 45 | 1 | 182 | 0 |
2 | 0 | 0 | 62 | 0 | 104 | 1 |
2 | 1 | 1 | 62 | 0 | 112 | 1 |
2 | 2 | 1 | 62 | 0 | 107 | 1 |
My primary analysis is a cox model. However, I now want to evaluate absolute incidence rates, and additive interactions.
I decided to do this with a poisson model that is trying to recapitulate the cox model as closely as possible. example code:
poisson insulin_use ibn.year age sex glucose white_race, irr
this works nicely, but now I would like to use this model to predict the absolute incidence rates in strata of predictors, adjusted for other predictors.
For example, I would like to say that the predicted incidence rate for females, adjusted for age, glucose, and race, is 5.6 events / 100 person years.
Then I would like to look at interactions with race, etc.
I have seen folks use the marginal command for this sort of thing, but not using data in the long format like this, and i'm wondering exactly how to set it up to give correct absolute incidence rate estimates.
Thanks for any guidance.
Comment