I am exploring the link between the introduction of a stewardship policy and the consumption of antibiotics. I have time-series data for ~150 antibiotics for 8 counties (not every antibiotic is used in every county). Antibiotics are categorized into 4 classes - this is a categorical variable in the dataset.
I xtset where the panelvar is the antibiotic-county (~650 groups). The timevar is quarterly data between 2013 and 2018. Overall, there are ~14,000 observations.
The policy was introduced at the same time in all counties (q3 2017) & is expected to have a differential effect on the 4 different classes of antibiotics included.
I want to explore the effect using a linear regression model with an interaction term.
Code:
egen panel = group(product county) gen policy = qdate>= tq(2017q3) xtset panel qdate, q xtreg vol_percap policy##class i.county i.year, re robust contrast policy@class, effects
Could I also create a variable that would enable me to extract this directly from the regression output as follows:
Code:
gen polintensity = policy replace polintensity = class if policy!=0 xtreg vol_percap i.polintensity i.class i.county i.year, re robust
I really appreciate any advice on this to check I'm on the right lines. I can paste the full Stata output if useful.
0 Response to Interpreting an interaction term in a panel linear regression model
Post a Comment