Looking at the European social survey ...
I'm interested in how the effect of being divorced (divorced=1, not divorced=0) has on mental health conditions (mental) -- how this effect changes according to the years of education an individual has obtained (eduyrs).
I started by doing a regression... code:
xi: regress mental country_group gender age c.age#c.age religscale lmoutsider i.esec7 children ///
i.divorced*eduyrs
I've interpreted results and found the effect to be present. I have manually calculated by intercept, b1, b2, b3 and therefore the slopes etc.
Then I want to use stata to plot this by doing predicted values (margins).
I've tried a million codes and none of them work .. does anyone have any pointers?
tried codes:
margins i.divorced, at (eduyrs=(0(2)22))
marginsplot
margins divorced, at (eduyrs=(0(2)22))
marginsplot
margins at (eduyrs=(0(2)22)), over divorced
marginsplot
I'm interested in how the effect of being divorced (divorced=1, not divorced=0) has on mental health conditions (mental) -- how this effect changes according to the years of education an individual has obtained (eduyrs).
I started by doing a regression... code:
xi: regress mental country_group gender age c.age#c.age religscale lmoutsider i.esec7 children ///
i.divorced*eduyrs
I've interpreted results and found the effect to be present. I have manually calculated by intercept, b1, b2, b3 and therefore the slopes etc.
Then I want to use stata to plot this by doing predicted values (margins).
I've tried a million codes and none of them work .. does anyone have any pointers?
tried codes:
margins i.divorced, at (eduyrs=(0(2)22))
marginsplot
margins divorced, at (eduyrs=(0(2)22))
marginsplot
margins at (eduyrs=(0(2)22)), over divorced
marginsplot
Comment