Dear friends,
I need to create a marginsplot with a histogram on the horizontal ax, reflecting the distribution of X variable.
Here is my code:
How can I add a histogram of X variable to the plot? There should be a command like this:
* I am using STATA 18.
I need to create a marginsplot with a histogram on the horizontal ax, reflecting the distribution of X variable.
Here is my code:
Code:
logit secondops v2x_polyarchy c.pve##c.agreeus c.loggdp, vce(cluster COWcode), if year>2017 & year<2022 margins, dydx(c.pve) at (agreeus=(0(.1)1)) marginsplot, recastci(rarea)
Code:
marginsplot, recastci(rarea) hist(c.agreeus)