Announcement

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

  • margins after xtabond2

    Dear Statalist members,

    I would like to use the >margins< command to compute adjusted predictions and marginal effects after running a difference GMM model by >xtabond2<. When I call the command, however, Stata returns the output preceded by a warning message: "Warning: cannot perform check for estimable functions".

    What does this message mean? are there any latent/unobserved components of the GMM model that >margins< does not integrate over?

    Here is my code:

    Code:
    webuse abdata
    xtabond2 n L.n w k yr*, gmm(L.n, lag(1 .)) robust twostep
    margins
    Relatedly, perhaps - I am a bit surprised that >margins< does not return the sample mean of the outcome after GMM:

    Code:
    qui xtabond2 n L.n w k yr*, gmm(L.n, lag(1 .)) robust twostep
    *
    margins
    *
    gen insample = (e(sample)==1)
    sum n if insample==1
    Could someone explain what is going on here? Ultimately, can >margins< be used after >xtabond2< to obtain meaninful estimates ofthe marginal means and their standard errors?


    Thanks a lot!


    Dr. Luca J. Uberti
    Department of Economics and Management
    University of Luxembourg




  • #2
    Luca: I haven't tried margins with xtabond2. I'm curious: For the model you estimated, what are you expecting from margins that you can't get from the coefficients? If xtabond2 supports margins then in the above command you'll just get the coefficients back again. Do you want to include a square or interaction?

    Comment


    • #3
      Dear Jeff, thank you for your response. The code above was just meant to be illustrative. In the actual specification that we would like to estimate, we have a squared term, and we would like to obtain adjusted predictions of the outcome, over the range of the variable that enters quadratically. So (assuming that the relationship between n and k is non-linear, we would have something like this:

      Code:
      xtabond2 n L.n w c.k c.k#c.k yr*, gmm(L.n, lag(1 .)) robust twostep
      margins, at(k=(-4(0.5)3.5))
      (again, this is just to illustrate the code as in this model above there is no significant non-linear effect..)

      Comment


      • #4
        Got it. It's for prediction, not partial effects. My guess is that you're out of luck but hopefully someone else knows. I could show you how to obtain the average marginal effects but not the predicted values. This actually raises the issue of what you are doing about the unit-specific fixed effects. I guess they're additive so they don't affect the shape.



        Comment


        • #5
          Thank you. We are also using margins to obtain partial effects after including an interaction term, but yes, the main concern is to obtain predictions. The warning message pops up either way.

          Comment


          • #6
            In overidentified models, two-step GMM with an optimal weighting matrix does not guarantee that the residuals have mean zero in finite samples. Consequently, the fitted values can have a different mean than the outcome variable. The results that are returned by margins seem to be correct.

            I have not used margins a lot, so cannot say anything about the warning message.

            Aside from that, here are a few comments on your xtabond2 specification. (Maybe you just have oversimplified the model. If so, then ignore.)
            • Your model does not include any instruments for the variables w k yr*. Technically, you have sufficiently many instruments but it is highly unusual not to instrument w and k with their own lags / lagged differences. The time dummies you definitely need to include explicitly as instruments.
            • If you specify time dummies with the notation yr*, some of them will be shown as "omitted" in the regression output. In this case, xtabond2 produces incorrect results for the overidentification tests. See point 2 in my collection of bugs in xtabond2. You either need to make sure that you only include the correct number of time dummies in the command line, or you could resort to my xtdpdgmm command as an alternative.
            https://www.kripfganz.de/stata/

            Comment


            • #7
              Dear Sebastian,

              Apologies for the slow response time, and thank you so much for your comments.

              "In overidentified models, two-step GMM with an optimal weighting matrix does not guarantee that the residuals have mean zero in finite samples". I did not know this. Thank you for pointing it out. That explains some of my doubts above.

              As for the other tips, I agree, and I am aware of the "bugs". The code above was just a simplified example intended to illustrate my question

              Best,

              Luca

              Comment

              Working...
              X