Announcement

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

  • Anti-log x-axis (predicted probabilities marginsplot)

    I am using a logged variable as an independent variable in a logit model. When I graph predicted probabilities, obviously the x-axis displays these logged variables. I know it is possible to use a logarithmic scale with arithmetic variables. Is it possible to scale the x-axis in reverse? That is, could I graph predicted probabilities on a non-logged scale?

  • #2
    To my knowledge, Stata's graph commands do not have an option to use an exponentiated scale.

    What you can do is a somewhat complicated workaround. The -margins- command has an undocumented -saving()- option. Use that to save the -margins- results to a file. Then -use- that file. You will probably want to rename the variables, because Stata has given them some rather wonky names that don't resemble the names you gave them originally. Then you can exponentiate the x-variable in the data set and use suitable -graph twoway- commands to make your graph instead of -marginsplot-.

    Comment


    • #3
      Thank you for this. I had not known about the -saving()- option. I will keep that in mind for future uses of -margins-

      Comment


      • #4
        It's undocumented, which implies that StataCorp could take it away, or make it do something very different, without notice, at any time. But it's been there and behaved consistently since at least version 14.2 that I know of. I don't really understand why StataCorp does not make this a full-fledged part of -margins-. I've had many occasions to use it myself, and so have others I know. I sure wish they would.

        Comment

        Working...
        X