Hi all, thanks for reading. I understand how to graph a scatter plot between two variables using 'twoway'. However, how do I generate a scatter plot including an interaction term and covariates? I searched here and didn't see a solution yet. I'm new to the forum, so I may have missed it: apologies if so.
regress flossesused age gender i.ethnicity pastflossweek c.cond2##c.ce2
margins, at(ce2=(.45 1) cond2=(0 1))
marginsplot
That's the code I'm using now, simplified for this post. The graph doesn't yield scatter, even if I call 'marginsplot recast(scatter)': in that case, it just gives the point estimates of the margins and doesn't show scatter or a fitted line.
regress flossesused age gender i.ethnicity pastflossweek c.cond2##c.ce2
margins, at(ce2=(.45 1) cond2=(0 1))
marginsplot
That's the code I'm using now, simplified for this post. The graph doesn't yield scatter, even if I call 'marginsplot recast(scatter)': in that case, it just gives the point estimates of the margins and doesn't show scatter or a fitted line.
Comment