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)
Array
I wonder if we can add vertical lines, say at x=0 and x=0.5? Thanks.
0 Response to Add a vertical line?
Post a Comment