Dear Stata members,
I am running Interrupted Time Series on my data set. My question is that, when I run ITS with my covariates and plot the post trend figure, the figure does not represent the coefficients (slopes) I obtained in the regression.
If you look at the code and the figure bellow, you can see that in the regression, the slope after the intervention is negative while in the figure the slope after the intervention is positive. The figure seems to represent the ITS result without any covariates. So could anyone please explain me how can I interpret this?

I am running Interrupted Time Series on my data set. My question is that, when I run ITS with my covariates and plot the post trend figure, the figure does not represent the coefficients (slopes) I obtained in the regression.
If you look at the code and the figure bellow, you can see that in the regression, the slope after the intervention is negative while in the figure the slope after the intervention is positive. The figure seems to represent the ITS result without any covariates. So could anyone please explain me how can I interpret this?
Code:
. xtset pannel_var weeks_from_start Panel variable: pannel_var (unbalanced) Time variable: weeks_from_start, -36 to 16, but with gaps Delta: 1 unit . . xtitsa positivity_rate if weeks_from_start < 14 & weeks_from_start > -10, single trperiod(0) posttrend figure replace Panel variable: pannel_var (unbalanced) Time variable: weeks_from_start, -36 to 16, but with gaps Delta: 1 unit ------------------------------------------------------------------------------ _positivit~e | Coefficient Std. err. z P>|z| [95% conf. interval] -------------+---------------------------------------------------------------- _t | -.0023408 .0002131 -10.99 0.000 -.0027585 -.0019232 _x0 | -.0395572 .0024548 -16.11 0.000 -.0443685 -.0347459 _x_t0 | .0043239 .0003358 12.88 0.000 .0036658 .004982 _cons | .068182 .0013013 52.40 0.000 .0656315 .0707325 ------------------------------------------------------------------------------ Postintervention Linear Trend: 0 Treated: _b[_t]+_b[_x_t0] ------------------------------------------------------------------------------ Linear Trend | Coef. Std. Err. z P>|z| [95% Conf. Interval] -------------+---------------------------------------------------------------- Treated | .0019831 .0002735 7.25 0.000 .001447 .0025192 ------------------------------------------------------------------------------ . xtitsa positivity_rate i.weeks_from_start_pos i._x0#c.cases_norm i._x0#c.full_district_porportion i._x0#c.consent_rate_cumsum i._x0#c.black i._x0#c.white i._x0#c.hispanic i._x0#c.other i._x0#i.rural i._x0#i.title1 i._x0#i.charter i._x0#i.surv_group i._x0#i.masking_policy i._x0#i.school_category if weeks_from_start < 14 & weeks_from_start > -10, sngle trperiod(0) posttrend figure replace Panel variable: pannel_var (unbalanced) Time variable: weeks_from_start, -36 to 16, but with gaps Delta: 1 unit ------------------------------------------------------------------------------------------------ _positivity_rate | Coefficient Std. err. z P>|z| [95% conf. interval] -------------------------------+---------------------------------------------------------------- _t | -.0001731 .0001633 -1.06 0.289 -.0004931 .0001469 _x0 | -.1342962 .0185167 -7.25 0.000 -.1705883 -.0980041 _x_t0 | -.004014 .0013141 -3.05 0.002 -.0065896 -.0014385 | weeks_from_start_pos | 30 | -.0523541 .0020964 -24.97 0.000 -.056463 -.0482451 32 | -.0853062 .0023276 -36.65 0.000 -.0898681 -.0807442 34 | -.0953261 .0026281 -36.27 0.000 -.100477 -.0901752 36 | -.0704673 .0143642 -4.91 0.000 -.0986207 -.042314 38 | -.0579889 .0117729 -4.93 0.000 -.0810633 -.0349145 40 | -.0447715 .0092084 -4.86 0.000 -.0628197 -.0267233 42 | -.0315088 .0067481 -4.67 0.000 -.0447348 -.0182828 44 | -.0158642 .0043358 -3.66 0.000 -.0243621 -.0073662 46 | 0 (omitted) 48 | 0 (omitted) | _x0#c.cases_norm | 0 | -.3758737 .0258557 -14.54 0.000 -.42655 -.3251973 1 | -.0242011 .0267325 -0.91 0.365 -.0765958 .0281937 | _x0#c.full_district_porportion | 0 | -.0519608 .0071885 -7.23 0.000 -.0660501 -.0378715 1 | -.0078668 .0071432 -1.10 0.271 -.0218671 .0061336 | _x0#c.consent_rate_cumsum | 0 | -.0254564 .00303 -8.40 0.000 -.0313951 -.0195176 1 | -.0026842 .0028657 -0.94 0.349 -.0083008 .0029324 | _x0#c.black | 0 | -.0001852 .0000719 -2.57 0.010 -.0003262 -.0000442 1 | .0001368 .0000717 1.91 0.057 -3.84e-06 .0002773 | _x0#c.white | 0 | -.0000706 .0000371 -1.90 0.057 -.0001432 2.07e-06 1 | -1.80e-06 .0000334 -0.05 0.957 -.0000674 .0000638 | _x0#c.hispanic | 0 | -.0000465 .0000535 -0.87 0.385 -.0001514 .0000585 1 | -.0000212 .0000564 -0.38 0.707 -.0001317 .0000893 | _x0#c.other | 0 | -.0001777 .0000615 -2.89 0.004 -.0002982 -.0000572 1 | -.0000154 .0000537 -0.29 0.775 -.0001207 .00009 | _x0#rural | 0 1 | -.0369213 .0055236 -6.68 0.000 -.0477473 -.0260953 1 0 | -.0031388 .005203 -0.60 0.546 -.0133366 .007059 1 1 | 0 (omitted) | _x0#title1 | 0 1 | -.0235955 .0035583 -6.63 0.000 -.0305696 -.0166214 1 0 | .0058005 .0034026 1.70 0.088 -.0008684 .0124694 1 1 | 0 (omitted) | _x0#charter | 0 1 | .0108525 .0043938 2.47 0.014 .0022409 .0194641 1 0 | -.0018951 .0042701 -0.44 0.657 -.0102644 .0064742 1 1 | 0 (omitted) | _x0#surv_group | 0 1 | 0 (omitted) 1 1 | 0 (omitted) | _x0#masking_policy | 0 0 | 0 (empty) 0 1 | 0 (omitted) 1 0 | -.0118502 .0033287 -3.56 0.000 -.0183743 -.0053262 1 1 | 0 (omitted) | _x0#school_category | 0#public | .0162698 .0024816 6.56 0.000 .0114059 .0211337 1#private | -.0005974 .0022571 -0.26 0.791 -.0050213 .0038264 1#public | 0 (omitted) | _cons | .2424306 .0079723 30.41 0.000 .2268053 .2580559 ------------------------------------------------------------------------------------------------ Postintervention Linear Trend: 0 Treated: _b[_t]+_b[_x_t0] ------------------------------------------------------------------------------ Linear Trend | Coef. Std. Err. z P>|z| [95% Conf. Interval] -------------+---------------------------------------------------------------- Treated | -.0041872 .0012989 -3.22 0.001 -.006733 -.0016414 ------------------------------------------------------------------------------ . end of do-file