Announcement

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

  • Marginsplot Predicted Probabillity Bar Graph

    Does know how to perform a marginsplot to predict the probability of two categorical variables (e.g. a binary variable and a factor variable)?

  • #2
    You may type:

    Code:
    marginsplot, recast(bar)
    Hopefully that helps.
    Best regards,

    Marcos

    Comment


    • #3
      Thanks, Marcos.

      Comment


      • #4
        Thanks. I was trying to make a predicted margins bar graph predicted the odds of mammogram for individuals with low trust and I wanted to put it all on the same graph. I entered this:

        logit mammogramadherent i.race_r i.age i.education2 i.employment c.income i.family i.married i.citizenship i.obesity i.insurance i.provider i.safety i.trust i.placeofresidence i.produce i.racerxsafety i.racerxtrust i.racerxproduce
        estimates store blm

        estimates restore blm

        margins, at(race_r == 0 trust= 1) vsquish

        margins, at(race_r == 1 trust= 1) vsquish

        margins, at(race_r == 3 trust= 1) vsquish

        marginsplot, recast(bar) plotopts(barw(.8))


        but I got the following thing (graph attached). How can I make the different racial categories show?
        Attached Files

        Comment


        • #5
          You may use - margins race - first.
          Best regards,

          Marcos

          Comment

          Working...
          X