Hello,
I'm using Stata 13 to graph the interaction shown in the following code:
xtreg rrpcm3 c.c_schcomp##c.c_studcomp bie_sch pctlep pctabsnt pcttchabsnt pcttchlft pctschlnch pctspeced ///
prepare2 prepare3 prepare4 dsex race lep iep slunch zprofcmp teachyrs2 teachyrs3 teachyrs4 deg2 ///
suburb town rural, cluster(schid)
The mean of the outcome variable is around 216. Both the predictors are continuous and centered at the mean. The interaction itself is cross-level.
Here's what I'm doing to graph my interaction:
margins, dydx(c_schcomp) at(c_studcomp=(-10(5)15)) vsquish
margins, at(c_schcomp=(-40 30) c_studcomp=(-10(5)15)) vsquish
marginsplot, noci x(c_schcomp) recast(line) xlabel(-40(10)30)
I could alternatively use this: mcp c_schcomp c_studcomp, at1(-40(10)30) at2(-10(5)15) mar(atmeans)
The graph below is produced.
Isn't it the case that the linear predictions from the plot produced should start near the mean from the regression equation?
Thanks in advance for any help you can offer.
Diego
I'm using Stata 13 to graph the interaction shown in the following code:
xtreg rrpcm3 c.c_schcomp##c.c_studcomp bie_sch pctlep pctabsnt pcttchabsnt pcttchlft pctschlnch pctspeced ///
prepare2 prepare3 prepare4 dsex race lep iep slunch zprofcmp teachyrs2 teachyrs3 teachyrs4 deg2 ///
suburb town rural, cluster(schid)
The mean of the outcome variable is around 216. Both the predictors are continuous and centered at the mean. The interaction itself is cross-level.
Here's what I'm doing to graph my interaction:
margins, dydx(c_schcomp) at(c_studcomp=(-10(5)15)) vsquish
margins, at(c_schcomp=(-40 30) c_studcomp=(-10(5)15)) vsquish
marginsplot, noci x(c_schcomp) recast(line) xlabel(-40(10)30)
I could alternatively use this: mcp c_schcomp c_studcomp, at1(-40(10)30) at2(-10(5)15) mar(atmeans)
The graph below is produced.
Isn't it the case that the linear predictions from the plot produced should start near the mean from the regression equation?
Thanks in advance for any help you can offer.
Diego
Comment