Announcement

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

  • Margins with tobit for elasticity estimates

    I am running a tobit regression to model education expenditures (zero forsome households) and tried using margins, eydx(*) to obtain the elasticity estimates, but I got a r(459) error saying "could not calculate numerical derivatives -- discontinuous region with missing values encountered".

    Could someone advise why this might be and how to resolve this?
    Some details about the data I am using: my explanatory variables are mostly categorical variables, and the sample size is 300,000+ of which 240,000 are left censored.

  • #2
    That's an odd one – we far more commonly see problems in the original estimation than in the margins statement. While we have some ideas about what to do with estimations that generate such problems, I haven't seen anything about what to do with margins with such problems. You do you seem to have an awful lot of left censored values although whether this or mainly having categorical variables generates the problem I can't tell.

    Do remember that you will increase your chances of useful answer by following the FAQ on asking questions.

    I guess one way around this would be instead of doing the elasticities do predicted values and calculate elasticities yourself if you need them.

    Comment


    • #3
      Thank you, could you suggest how to obtain predicted values and then calculate elasticities?

      Comment


      • #4
        Is it by obtaining linear prediction and exponentiation of the predicted values?

        Comment


        • #5
          Hi Parul
          I think something you are not considering here.
          the option of "elasticities" from margins, implicitly assumes that the predicted outcome is strictly positive. If it is zero or negative, you will see the warning you just mentioned.
          if unrestricted, your tobit model may be giving you negative predicted values. So, the question is, what exactly are you trying to obtain elasticities on?
          the latent value? the expected value? the conditional expectation?
          For the later two, you need to see into the options for tobit margins. specifically, look into the help for predict after tobit. once you decide what "predicted" outcome you are interested in, you will be able to estimate the elasticities.

          Example below is for different elasticities, depending on the predicted outcome
          Code:
          webuse mroz87, clear
          tobit whrs75 nwinc wedyrs wexper c.wexper#c.wexper wifeage kl6 k618, ll(0)
          margins, eyex(*)
          margins, eyex(*) predict(e(0,.))
          margins, eyex(*) predict(ystar(0,.))
          margins, eyex(*) predict(p(0,.))
          Last edited by FernandoRios; 07 Jul 2020, 07:26.

          Comment


          • #6
            I am including example data for better clarity.

            Code:
            clear
            input    byte    child_gender    int    edu_exp    float(govt    father_edu    siblings)
            0   0    0  0    1
            1   .    1  0    1
            1   0    1  0    1
            1   0    1  0    1
            1   0    0 11    1
            0   0    1 11    1
            0   0    1  6    2
            1   0    0  6    2
            1   0    1  6    2
            0   0    1  7    1
            1   0    0  7    1
            1   0    1  0    0
            1   0    1  0    1
            0   0    1  0    1
            1   0    1  .    0
            1   0    1  0    1
            0   0    1  0    1
            0   0    1  7    2
            0   0    1  7    2
            0   0    1  7    2
            1   .    1 10    1
            0   0    0 10    1
            0   0    0 12    1
            0   0    1 12    1
            1   0    1  5    2
            0   0    1  5    2
            0   0    1  5    2
            0   0    0 10    2
            0   0    0 10    2
            0   .    0 10    2
            1   0    0 12    2
            0   0    1 12    2
            0   0    1 12    2
            0   0    1 11    1
            1   0    1 11    1
            1   0    1  0    1
            0   0    1  0    1
            0   0    1  0    0
            1   0    1  0    0
            1   0    1  0    0
            .   .    .  .    0
            .   .    .  .    0
            .   .    .  .    0
            0   0    0 12    0
            0   0    0 10    0
            0   0    0  7    0
            1   0    0  .    0
            .   .    .  .    0
            .   .    .  .    0
            .   .    .  .    0
            1 300    0 10    1
            1 300    0 10    1
            0   0    0  .    0
            0 300    0 15    1
            1 300    0 15    1
            0 260    0 10    0
            0   0    0  6    0
            .   .    .  .    0
            0   0    0 12    1
            1   0    0 12    1
            .   .    .  .    0
            .   .    .  .    0
            .   .    .  .    0
            1   0    0 12    2
            1   0    0 12    2
            1   0    0 12    2
            .   .    .  .    0
            1   .    1  9    3
            0   .    1  9    3
            0   0    1  9    3
            0   .    1  9    3
            0   0    1  9    1
            1   0    1  9    1
            .   .    .  .    0
            0   0    1 10    0
            .   .    .  .    0
            1   .    1  0    2
            1   .    1  0    2
            1   .    1  0    2
            .   .    .  .    0
            1   0    0 10    1
            0   0    0 10    1
            .   .    .  .    0
            1   .    0 12    0
            .   .    .  .    0
            .   .    .  .    0
            .   .    .  .    0
            .   .    .  .    0
            .   .    .  .    0
            0   .    0 10    0
            .   .    .  .    0
            1   .    1 10    1
            1   .    1 10    1
            0   .    1  0    1
            0   .    1  0    1
            0   0    1 12    0
            0   0    1 10    1
            1   0    0 10    1
            0   0    1  3    1
            0   0    1  3    1
            end
            I have run the following commands:
            Code:
            tobit edu_exp i.child_gender father_edu siblings i.govt, ll(0)
            Code:
            margins, eydx(*)
            I am getting an error r(459) as mentioned in #1.

            Using
            Code:
            margins, dydx(*)
            doesn't give a problem, but the estimates are same as those obtained after running tobit command. Is it because of a linear prediction'?

            Kindly help.

            Comment


            • #7
              Thank you, Fernando. Your explanation and example code is starting to clarify matters for me. If you could provide some insight after looking at my example dataset, I will be extremely grateful.

              Highly appreciate your help.

              Comment


              • #8
                not much else to say other than,
                you need to decide what "outcome" is better for you. (which one aligns to your research question )

                Comment


                • #9
                  Got it, thanks a ton.

                  Comment


                  • #10
                    If I may ask a related question here: If I want to run a hurdle model with
                    Code:
                    nehurdle
                    command, and I want semi elasticity estimates, is it better to use the log of dependent variable in the regression with exponential option, or should I instead use margins eydx with predict option as above?

                    Comment

                    Working...
                    X