Hi all,
I have an interaction term in a regression model and I need to plot it. It is binary by continuous (x: binary, z: continuous). However, I do not know how I can plot model one above and below the standard deviation of the continuous variable.
I would appreciate it if you could help me on this matter. Below is the code that I used. But I got the error: invalid num list
regress y x z x#c.z
return list
global effa = round(r(mean) + r(sd),0.1)
global eff = round(r(mean),0.1)
global effb = round(r(mean) - r(sd),0.1)
margins, at(x = (0 1) z = ($effa, $eff $effb))
marginsplot
I also tried
margins. x , at (z = ($effa, $eff $effb))
Thank you!
I have an interaction term in a regression model and I need to plot it. It is binary by continuous (x: binary, z: continuous). However, I do not know how I can plot model one above and below the standard deviation of the continuous variable.
I would appreciate it if you could help me on this matter. Below is the code that I used. But I got the error: invalid num list
regress y x z x#c.z
return list
global effa = round(r(mean) + r(sd),0.1)
global eff = round(r(mean),0.1)
global effb = round(r(mean) - r(sd),0.1)
margins, at(x = (0 1) z = ($effa, $eff $effb))
marginsplot
I also tried
margins. x , at (z = ($effa, $eff $effb))
Thank you!
Comment