Announcement

Collapse
No announcement yet.
X
  • Filter
  • Time
  • Show
Clear All
new posts

  • Marginsplot with hist option

    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:

    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)
    How can I add a histogram of X variable to the plot? There should be a command like this:

    Code:
    
    marginsplot, recastci(rarea) hist(c.agreeus)
    * I am using STATA 18.
    Last edited by Nihat Mugurtay; 15 Oct 2023, 08:06.
Working...
X