Hi there,

I am running a household fixed effects model on some panel data to estimate the effect of 'length of exposure (in months) to the intervention' on a bunch of outcome indicators, and I want to use marginsplot to see how the 'treatment effect' varies over months of exposure. My model (which includes a second order team) is as follows:

xtreg outcome exposure exposure_sq, fe cluster(ea)

In order to get the figure that I want (i.e. treatment effect only and not the fitted values of the outcome variable), I would need to exclude the constant that is estimated in the regression but I am unable to do this.

Instead of using marginsplot, I did consider using the twoway function approach where I use:

twoway function y=_b[exposure]*x + _b[exposure_sq]*x^2

This works very well - but I can't plot the confidence intervals - hence the need for marginsplot.

Does anybody have a suggestion? I would be very grateful.

Thanks very much!