Announcement

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

  • Marginsplot question

    Hey everyone. I took a course over a decade ago where I learned STATA. I realized I needed it again when my latest research required the use of logistic regressions. I have come leaps and bounds in figuring it out, but I have one issue that no amount of searching has found the answer to.

    I am running two logistic regressions. The two have different DVs but all the same indicators. I would like to plot the predicted probabilities of these two different outcomes on the SAME marginsplot. I have figured out how to do a plot, how to set the indicators to the values that I want, etc. What I can't figure out is how to get the two different variables plotted on one graph.

    My guess would be to save the predicted probabilities for each as its own variable and then plot those two variables? I can't figure out how to do that. Any help would be appreciated.

    My two logits are:

    1. logit BoughtSex i.ACES FullTimeD Age GenderDummy RaceDummy i.Sexuality if Sexuality!=4, or
    2. logit SellSex i.ACES FullTimeD Age GenderDummy RaceDummy i.Sexuality if Sexuality!=4, or

    Thank you!

  • #2
    Welcome to the Stata Forum/Statalist.

    That’s great you came to work anew with Stata (not STATA, please read the FAQ).

    Instead of logit, you may use - logistic - to get the ORs directly (I mean, without the use of or option).

    That said, you can use - predict - for both models. Maybe it is possible, but I don’t know if we can put 2 marginsplots in the same plot. An alternative would be plotting 2 graphs, then use - graph combine - command.
    Best regards,

    Marcos

    Comment


    • #3
      My combomarginsplot is designed for just this task. Here's an example using the auto dataset:

      Code:
      ssc install combomarginsplot
      sysuse auto
      gen dv2 = round(uniform())
      logit foreign mpg gear
      margins, at(mpg=(10(5)50)) saving(marg1)
      logit dv2 mpg gear 
      margins, at(mpg=(10(5)50)) saving(marg2)
      combomarginsplot marg1 marg2, labels("Foreign Car" "Fake DV")

      Comment


      • #4
        [QUOTE=Nicholas Winter;n1449805]My combomarginsplot is designed for just this task.

        Thank you! I did not know this command and talked to several people who use Stata who also didn't know how to do it. Worked like a charm!

        Graph Buy Sell Sex Compare ACE graph.gph

        Comment

        Working...
        X