Dear Statalist Users,
I am reaching out to seek for some advice and help on how to plot conditional effects of x on y at different values of moderator.
I am estimating a simple OLS regression with DV, IV a MODERATOR (with interaction term) and 4 COVARIATES. I cluster as observations are nested into groups.
All variables are continuous except cov3.
reg y = x mod int_term cov1 cov2 cov3 cov4, clusted(org)
The coefficient on the interaction term - is positive and stat significant.
It supports my intuition that the main substantive relationship between x and y is attenuated at increasing levels of MOD.
I would like to graph this relationship into two ways:
First, by showing the change in slope of x-> y relationship at different levels of MOD (say 25th, 50th and 75th percentile of MOD).
This would be something like y on y-axis and x on the x-axis with three (or more) lines plotting the relationship.
An illustration below from Pollack et al (2012, J of Org Behavior)

Second, I would like to plot regions of significance for the main relationship (x->y) at different levels of MOD.
An example is below

I have found instructions and done it in the following way:
* working on the graph of the moderation effect*
reg y x MOD cov1 cov2 cov3 cov4, cluster(org_id)
summ MOD
local very_low = r(mean) - 2*r(sd)
local low = r(mean) - r(sd)
local medium = r(mean)
local high = r(mean) + r(sd)
local very_high = r(mean) + 2*r(sd)
margins, at(MOD = (`very_low' `low' `medium' `high' `very_high'))
marginsplot
or by specifying meaningful values for MOD
reg y x MOD cov1 cov2 cov3 cov4, cluster(org_id)
margins, at(MOD = (5.333333 5.805556 6.033333))
marginsplot
I do not quite get what I want.
Sorry for the lengthy post
Amedeo
I am reaching out to seek for some advice and help on how to plot conditional effects of x on y at different values of moderator.
I am estimating a simple OLS regression with DV, IV a MODERATOR (with interaction term) and 4 COVARIATES. I cluster as observations are nested into groups.
All variables are continuous except cov3.
reg y = x mod int_term cov1 cov2 cov3 cov4, clusted(org)
The coefficient on the interaction term - is positive and stat significant.
It supports my intuition that the main substantive relationship between x and y is attenuated at increasing levels of MOD.
I would like to graph this relationship into two ways:
First, by showing the change in slope of x-> y relationship at different levels of MOD (say 25th, 50th and 75th percentile of MOD).
This would be something like y on y-axis and x on the x-axis with three (or more) lines plotting the relationship.
An illustration below from Pollack et al (2012, J of Org Behavior)
Second, I would like to plot regions of significance for the main relationship (x->y) at different levels of MOD.
An example is below
I have found instructions and done it in the following way:
* working on the graph of the moderation effect*
reg y x MOD cov1 cov2 cov3 cov4, cluster(org_id)
summ MOD
local very_low = r(mean) - 2*r(sd)
local low = r(mean) - r(sd)
local medium = r(mean)
local high = r(mean) + r(sd)
local very_high = r(mean) + 2*r(sd)
margins, at(MOD = (`very_low' `low' `medium' `high' `very_high'))
marginsplot
or by specifying meaningful values for MOD
reg y x MOD cov1 cov2 cov3 cov4, cluster(org_id)
margins, at(MOD = (5.333333 5.805556 6.033333))
marginsplot
I do not quite get what I want.
Sorry for the lengthy post
Amedeo
Comment