I estimate a model for the probability of never being married with an interaction of two categorical variables, say race (White/Black/Other) and collgrad (Not College Grad/College Grad).
A familiar problem with the graphical representation of the results is that the plotted confidence intervals might be misleading for judging whether a difference between two groups is statistically significant. Hence, I omit them from the plot and use margins contrast to provide test statistics for the differences between the various groups. In this example, the difference between Blacks and Whites within the group of Non-College Grads is significant.
Now I would like to include this information in the marginsplot by filling the individual marker for Blacks within the Non-College Grads group or by changing its color. How would I do that (besides manual editing)?
Andrew provides some guidance for a similar case (https://www.statalist.org/forums/forum/general-stata-discussion/general/1416513-vary-marker-color-in-marginsplot). The difference to my case is that I use marginsplot to display the group levels but obtain the information on the significant differences between them from a different command. How would I combine them?
A familiar problem with the graphical representation of the results is that the plotted confidence intervals might be misleading for judging whether a difference between two groups is statistically significant. Hence, I omit them from the plot and use margins contrast to provide test statistics for the differences between the various groups. In this example, the difference between Blacks and Whites within the group of Non-College Grads is significant.
Now I would like to include this information in the marginsplot by filling the individual marker for Blacks within the Non-College Grads group or by changing its color. How would I do that (besides manual editing)?
Andrew provides some guidance for a similar case (https://www.statalist.org/forums/forum/general-stata-discussion/general/1416513-vary-marker-color-in-marginsplot). The difference to my case is that I use marginsplot to display the group levels but obtain the information on the significant differences between them from a different command. How would I combine them?
Code:
sysuse nlsw88, clear reg never_married i.race##i.collgrad margins race#collgrad, dydx() marginsplot, recast(scatter) x(collgrad) noci plot1opts(msymbol(Oh)) plot2opts(msymbol(Dh)) plot3opts(msymbol(Sh)) title("") ytitle("Never married") reg never_married i.race##i.collgrad margins r.race@collgrad, contrast(nowald pveffects) post
Comment