Dear all, I generate a data set and estimate an interaction model as follows.
Code:
clear
set seed 123
set obs 1000
gen x = runiform() 
gen z = runiform() 
gen xz = x*z

// interaction model
gen y1 = 1+3*x-2*z+1*xz+rnormal()
reg y1 c.x##c.z, robust
quietly margins, dydx(x) at(z=(0(0.1)1))
quietly marginsplot, recast(line) recastci(rline) ciopts(lpattern(dash) lcolor(red)) yline(0)
The graph is

Array

I wonder if we can add vertical lines, say at x=0 and x=0.5? Thanks.