Hi, I'm running a mixed poisson model using mepoisson.
I'm modeling events (yrtotal) per 1000 people, and I want to get the marginsplot of the interaction.
My code runs without issues but the plot is the same when I use nt as the exposure or nt1000.
The correct model specification is with nt1000 as my outcome is rate per 1000 people.
Anyone knows why this is happening or how to go about this?
thank you
This is my code:
I'm modeling events (yrtotal) per 1000 people, and I want to get the marginsplot of the interaction.
My code runs without issues but the plot is the same when I use nt as the exposure or nt1000.
The correct model specification is with nt1000 as my outcome is rate per 1000 people.
Anyone knows why this is happening or how to go about this?
thank you
This is my code:
Code:
* Create exposure variable * total N per year bys measurment_yr: gen nt = _N * divide by 1000 to get the correct offset gen nt1000 = nt/1000 * Crude model mepoisson yrtotal i.population##c.measurement_yr, /// exposure(nt1000) || new_id:, irr * Estimate marginal effects for the interaction margins population, at(measurement_yr = (0(1)2)) * Plot marginal effects marginsplot, plotopts(msize(*0.65)) /// ytitle("Visits per 1000 clients") /// title("Crude model") /// xtitle("") /// legend(rows(1) cols(2) size(small)) /// name(EDU_AE_crude_`lv'100, replace)
Comment