Hi,
I have an interrupted time series model with count outcome, using xtgee negative binomial with a ln(total_population) as an offset. To model time, I have continuous time (timeqtr). An event indicator (post_event=1 if after event and post_event=0 if before). And then q_post_event for quarters after the event (turning on at 1 one quarter after the event). That means post_event is the "immediate time impact" while "q_post_event" is sustained effects over time. Both time trends interact with a census tract's level of disadvantage.
I am getting quite confused by the margins output. Is margins "exponentiated linear prediction considering offset" giving me the expected number of counts of the outcome? So, if I set it to a certain timeqtr/post_event/q_post event combination, it is giving me the expected number of outcomes in that time unit? And is it counts per census tract, I assume? Per my reading of the manuals, I am getting (mu) or counts. Just wanted to confirm.
And if anyone can direct me to resources for confirming with hand calculation, it would be greatly appreciated.
Thank you!
gen logpop=ln(total_popx)
xtset geoid timeqtr
xtgee outcome c.timeqtr i.post_event##ib1.cdcat c.q_post_event##ib1.cdcat c.age_19_29_perc c.age_30_49_perc c.age_50_69_perc c.age_70_plus_perc, fam(nb) link(log) corr(independent) vce(robust) offset(logpop)
margins, at(timeqtr=-14 post_event=0 q_post_event=0)
I have an interrupted time series model with count outcome, using xtgee negative binomial with a ln(total_population) as an offset. To model time, I have continuous time (timeqtr). An event indicator (post_event=1 if after event and post_event=0 if before). And then q_post_event for quarters after the event (turning on at 1 one quarter after the event). That means post_event is the "immediate time impact" while "q_post_event" is sustained effects over time. Both time trends interact with a census tract's level of disadvantage.
I am getting quite confused by the margins output. Is margins "exponentiated linear prediction considering offset" giving me the expected number of counts of the outcome? So, if I set it to a certain timeqtr/post_event/q_post event combination, it is giving me the expected number of outcomes in that time unit? And is it counts per census tract, I assume? Per my reading of the manuals, I am getting (mu) or counts. Just wanted to confirm.
And if anyone can direct me to resources for confirming with hand calculation, it would be greatly appreciated.
Thank you!
gen logpop=ln(total_popx)
xtset geoid timeqtr
xtgee outcome c.timeqtr i.post_event##ib1.cdcat c.q_post_event##ib1.cdcat c.age_19_29_perc c.age_30_49_perc c.age_50_69_perc c.age_70_plus_perc, fam(nb) link(log) corr(independent) vce(robust) offset(logpop)
margins, at(timeqtr=-14 post_event=0 q_post_event=0)