Giter VIP home page Giter VIP logo

Comments (3)

sergiocorreia avatar sergiocorreia commented on August 14, 2024

The twicerobust option of the help file sheds some light about why this doesn't work.

AFAIK, ivregress with wmatrix will run two regressions (I forgot how exactly robust and wmatrix played together, but the helpfile links the PDF, and I recall I had some extra references about it somewhere).

The problem is that reghdfe only runs once, and to make reghdfe fully compatible with running two regressions (or more, for iterated gmm) will require changing the code of ivregress (which I can't do) in order to recompute the means in the middle.

It might be possible for you to compute the GMM by hand (by using hdfe.ado to do the demeaning, then running the first step, then recomputing, and so on), but sadly there is no automated way to do it.

from reghdfe.

achenzion avatar achenzion commented on August 14, 2024

Ok, yes. I see the issue.

See: http://www.stata.com/manuals13/rivregress.pdf (pg 7-10, 13-15)

To be clear with or without wmatrix() ivregress with two-step gmm runs two regressions. (see pg. 13)

  1. The first is the standard 2SLS IV regression and the residuals from this first step are taken to calculate the weighting matrix (either unadjusted, robust, clustered, etc) for...
  2. The gmm version of the IV regression which is reported with errors that are subject to the vce() command.

If the wmatrix() option is not specified then it is using the residuals from the first step assuming homoskedasticity.

You say that that reghdfe only runs once, but then how is it implementing both steps of two-step efficient gmm? I do not see any reason to be recomputing between the first and second step outlined above. Please let me know if I misunderstood. Thank you for your response.

from reghdfe.

sergiocorreia avatar sergiocorreia commented on August 14, 2024

It is not implementing both steps.

From the source code, what reghdfe does is:

  • If the estimator is gmm2s, replace the "vce(something)" option with "wmatrix(something) vce(unadjusted)" .
  • If twicerobust is specified, it will omit the vce() part, which as mentioned in the ivregress help file, is equivalent to letting it be the same as wmatrix().

Now, this is not strictly correct, as if ivregress is running two regressions we also want to run two demeanings (one for every regression).

On the other hand, the error introduced by demeaning twice appeared to be trivial, and one of the authors of ivreg2 suggested that there might still be better to include this option and have it "half baked" that to exclude it.

Let me know if you find that the difference in results wrt doing it the long way is significant. In my checks it wasn't but if I find cases where it is misleading I might remove it.

from reghdfe.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.