Announcement

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

  • About xtprobit, margins and the stored variables

    I'm using stata 14.1. The problem is that I want to store the marginal effects of a probit model and I want to store the mean of the dependent variable "stunted" ,but when I do the following it returns the mean of something that is stored in the "ereturn list" of margins. I don't know how to recover and store the actual mean of the variable "stunted" after obtaining the marginal effects.
    Code:
    eststo clear
    xtprobit stunted c1 c2 c3 c4
    eststo: margins, dydx(c1 c2) post
    estadd ysumm,mean

  • #2
    You didn't get a quick answer. Thank you for providing the code. The Stata output and sample data (using dataex) might increase the chance of a useful response from the list. I wonder if you're not replacing the xtprobit output with the margins output so estadd is trying to work with the margins rather than the dv in xtprobit. You could save the xtprobit outout, run margins, then restore xtprobit and do estadd.

    This is just a guess - I don't use estadd.

    Comment


    • #3
      Hello Marcos Fabian as I read so far, i believe the right code for margins after a xtprobit model is margins, dydx(*) predict(pu0)

      Comment

      Working...
      X