Hello people,
I run a linear regression model to explore the influence of some independent variables of the output of firms. I also included an interaction term, to show if the effect of variable x (continuous) depends on the rural/urban location of a firm (dichotomous). I got significant coefficients, so I want to take a closer look at this interaction effect, especially I want to visualize it. I read about margins, to be a good option for that, but most sources are related to non-linear or logit regression. So I am not sure, if this really is an approbate tool for a linear regression.
After storing the regression model. I run the margins command
and let Stata draw the graph via
.
This yields to the following result:

I would interpret the connection somehow like: An increasing X yields to an increasing y. The location has an effect on X and the effects, X has on y, is stronger in rural areas.
I would appreciate, if someone could give me a short feedback, if this is an approbate tool, and if so, if my interpretation is correct.
Thanks in advance.
KR
I run a linear regression model to explore the influence of some independent variables of the output of firms. I also included an interaction term, to show if the effect of variable x (continuous) depends on the rural/urban location of a firm (dichotomous). I got significant coefficients, so I want to take a closer look at this interaction effect, especially I want to visualize it. I read about margins, to be a good option for that, but most sources are related to non-linear or logit regression. So I am not sure, if this really is an approbate tool for a linear regression.
After storing the regression model. I run the margins command
Code:
margins, rural_urban, at(X=(0(10)100))
Code:
marginsplot, x(X)
This yields to the following result:
I would interpret the connection somehow like: An increasing X yields to an increasing y. The location has an effect on X and the effects, X has on y, is stronger in rural areas.
I would appreciate, if someone could give me a short feedback, if this is an approbate tool, and if so, if my interpretation is correct.
Thanks in advance.
KR

Comment