Hi all,
I'm estimating the heterogenous impacts (by gender) of a continuous treatment variable on an outcome. Here's a version of my regression model:
I want to create a marginsplot that plots predicted values for both categories of sex over a range of treatment. I've tried out several iterations of the margins post-estimation command, but I'm running into an issue wherein I'm unable to get predicted values for the category of sex coded as 0 (in my case, males). Here are three versions that I've tried:
They all give me the margins for sex=1, but not for sex=0 (the specific message is that it's not estimable), and as a result, the marginsplot is only plotted for sex=1. I would like to plot the margins for both categories of sex.
Any help would be appreciated. Thank you!
I'm estimating the heterogenous impacts (by gender) of a continuous treatment variable on an outcome. Here's a version of my regression model:
Code:
reghdfe y i.sex##c.treatment [controls], absorb(absorbvar) cluster(clustervar)
Code:
margins sex, at(treatment=(-1(1)1))
Code:
margins, at(sex=0 treatment=(-1(1)1)) at(sex=1 treatment=(-1(1)1))
Code:
margins, over(sex) at(treatment=(-1(1)1))
Any help would be appreciated. Thank you!
Comment