Announcement

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

  • Elasticity and Marginal Effect of Tobit Regression

    Hi! I have been using stata14 for about a week and have been piecing together information online and feel as though I am getting a decent handle on it for my purposes. After running a Tobit regression on my data set, I need to find the marginal effects (dy/dx) and elasticities (ey/ex). This is where I have not been able to find clear answers.

    For the marginal effect, I have told me simply running:

    mfx

    will work and others have told me running:

    mfx, predict(e(0,.))

    Likewise, post-Tobit elasticity, I have been seeing both:
    mfx, eyex
    and
    mfx, predict(e(0,.)) eyex

    If anyone has any insight on what the "predict(e(0,.))" function does, and if or why it may be necessary and wouldn't mind sharing their insights I would be greatly appreciative. In addition, if anyone knows has any recommendations or cautions with these results I would really appreciate it.

    Thanks in advance,

    Bryan Gensits
    Royal University of Bhutan: College of Natural Resources

    Bryan Gensits
    Royal University of Bhutan: College of Natural Resources

  • #2
    -mfx- is an old command that has been superseded by -margins-. If you have run your -tobit- regression with factor notation used, then marginal effects are obtained with -margins, dydx()- and elasticities with -margins, eyex()-. Since you are new to Stata, it is best to form good habits from the start and learn to use Stata's up-to-date features.

    You can learn all about factor-variable notation by running -help fvvarlist-; more information is available in the corresponding section of the on-line manuals. You can analogously learn about -margins- that way, but https://www3.nd.edu/~rwilliam/stats/Margins01.pdf provides a more focused, simpler introduction that covers most of what is needed.

    Comment


    • #3
      Hello Bryan,

      Welcome to the Stata Forum/Statalist

      To start, I recommend you take a look on:

      Code:
      . help margins
      Also, please read the FAQ on how to share command and output under CODE delimiters or by instaling the SSC dataex.

      That said, I believe you wish something like this:

      Code:
      . sysuse auto
      (1978 Automobile Data)
      
      .  generate wgt=weight/1000
      
      . tobit mpg wgt i.foreign, ll(17)
      
      Tobit regression                                Number of obs     =         74
                                                      LR chi2(2)        =      76.31
                                                      Prob > chi2       =     0.0000
      Log likelihood = -162.52596                     Pseudo R2         =     0.1901
      
      ------------------------------------------------------------------------------
               mpg |      Coef.   Std. Err.      t    P>|t|     [95% Conf. Interval]
      -------------+----------------------------------------------------------------
               wgt |  -7.797866   .8701668    -8.96   0.000    -9.532512    -6.06322
                   |
           foreign |
          Foreign  |  -2.336203   1.259564    -1.85   0.068    -4.847097     .174691
             _cons |   44.93177   2.792179    16.09   0.000     39.36567    50.49788
      -------------+----------------------------------------------------------------
            /sigma |   3.781249   .3593973                      3.064804    4.497694
      ------------------------------------------------------------------------------
                  18  left-censored observations at mpg <= 17
                  56     uncensored observations
                   0 right-censored observations
      
      . margins , eyex(wgt)
      
      Average marginal effects                        Number of obs     =         74
      Model VCE    : OIM
      
      Expression   : Linear prediction, predict()
      ey/ex w.r.t. : wgt
      
      ------------------------------------------------------------------------------
                   |            Delta-method
                   |      ey/ex   Std. Err.      z    P>|z|     [95% Conf. Interval]
      -------------+----------------------------------------------------------------
               wgt |  -1.343588   .2084189    -6.45   0.000    -1.752082   -.9350948
      ------------------------------------------------------------------------------
      
      . margins foreign, eyex(wgt)
      
      Average marginal effects                        Number of obs     =         74
      Model VCE    : OIM
      
      Expression   : Linear prediction, predict()
      ey/ex w.r.t. : wgt
      
      ------------------------------------------------------------------------------
                   |            Delta-method
                   |      ey/ex   Std. Err.      z    P>|z|     [95% Conf. Interval]
      -------------+----------------------------------------------------------------
      wgt          |
           foreign |
         Domestic  |  -1.322087   .2002683    -6.60   0.000    -1.714605    -.929568
          Foreign  |  -1.565491   .3739453    -4.19   0.000     -2.29841   -.8325716
      ------------------------------------------------------------------------------
      Hopefully that helps.
      Last edited by Marcos Almeida; 04 Mar 2017, 10:14.
      Best regards,

      Marcos

      Comment


      • #4
        Clyde and Marcos,

        Thank you both very much for your responses. The PDF you provided, Clyde, goes over exactly what I am trying to do and I greatly appreciate you sharing that with me. The margins command is diverse enough solve exactly what I need it to at the moment elegantly.

        Also, thank you, Marcos for explaining how to share code in STATALIST, I will definitely use that in the future.

        Best,
        Bryan Gensits
        Royal University of Bhutan: College of Natural Resources
        Bryan Gensits
        Royal University of Bhutan: College of Natural Resources

        Comment


        • #5
          The PDF you provided, Clyde, goes over exactly what I am trying to do and I greatly appreciate you sharing that with me.
          You're welcome. But the thanks are really owed to Richard Williams for writing it!

          Comment


          • #6
            Bryan Gensits I recommend you take a look on the semielasticities in the Stata Manual as well. They may provide a handy output, depending on the way you wish to show the predictions;

            Margins estimates and reports margins of responses and margins of derivatives of responses, also
            known as marginal effects. A margin is a statistic based on a fitted model in which some of or all the
            covariates are fixed. Marginal effects are changes in the response for change in a covariate, which
            can be reported as a derivative, elasticity, or semielasticity.
            [...]
            dydx(varlist) estimate marginal effect of variables in varlist
            eyex(varlist) estimate elasticities of variables in varlist
            dyex(varlist) estimate semielasticity—d(y)=d(lnx)
            eydx(varlist) estimate semielasticity—d(lny)=d(x)
            Best regards,

            Marcos

            Comment


            • #7
              Marcos Almeida Great reference, thanks!

              One more question for you: when I run
              Code:
              tobit LAND i.SOIL i.TO i.YIELD i.STRIGA i.DROUGHT AGE i.HEAD TEST VISIT WKSHOP, ll(0)
              margins , eyex(SOIL)
              I am given error
              Code:
              factor variables not allowed in option eyex()
              However, if I do not input my variables as being factor variables and run
              Code:
              tobit LAND SOIL TO YIELD STRIGA DROUGHT AGE HEAD TEST VISIT WKSHOP, ll(0)
              margins , eyex(SOIL)
              Stata outputs identical results in the tobit table in terms of coefficiants, etc. and I do not get an error when I look of the elasticity of any given variable.

              I do not know enough about the inner workings of stata at this point to know if this is mathamatically correct. Do you fundimentally see any problem with this approach?

              Thanks again,
              Bryan Gensits

              Bryan Gensits
              Royal University of Bhutan: College of Natural Resources

              Comment


              • #8
                Hello Bryan,

                You may wish to take a close look in #3.

                There, on purpose, I shared two examples.

                One them presents the average marginal effects (AME) in elasticities only for a continuous variable, whereas the other presents the AME of the very same continuous variable to different levels of the factor variable.

                By the way, Richard William's lectures (hand-outs, presentations, whatever the name is) on margins, including the one shared in #2, are a "must read".

                Really so. Definitely.
                Best regards,

                Marcos

                Comment


                • #9
                  Where can I find an articles in magazines (jornal´s) that contain the syntax "do's" in stata? Thank You

                  Comment


                  • #10
                    Ariel Vazquez This is a quite different theme, ideally, to be posted under a different thread. That said, the Stata Manual and the Stata Journal are the references you should always look for.
                    Best regards,

                    Marcos

                    Comment


                    • #11
                      I have ran a tobit spatial panel model and I would wish to estimate elasticities at specified levels of some independent variables. The code I have used is as follows;

                      sptobitsarxt $ylist $xlist , nc(42) wmfile(weights2) dist(weib) mfx(log) tests ll(0) tolog

                      Although marginal effects and elasticities are provided at the end, these are evaluated at the means of the RHS variables. If I however wish to calculate margins using for example the code;
                      margins, predict(ystar(0,.)), I get the response

                      margins not appropriate after mean
                      r(322);

                      Could someone give me a hint of how I should proceed?

                      Comment

                      Working...
                      X