Announcement

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

  • Restoring first stage estimates with ivreghdfe (ivreg2 based command) and multiple endogenous variables/instruments

    Hi, I am running a regression with ivreghdfe (which builds on ivreg2) and I want to restore the first stage estimates. I have done so previously. Usually, I would do something like this for a single endogenous variable and a single instrument:
    Code:
    ivreghdfe outcome (endogenous=instrument), absorb(fe) savefirst
    matrix first = e(first)
    estimates restore _ivreg2_endogenous
    However, now I am working witha regression with multiple endogenous and multiple instruments, something like:
    Code:
    local endogenous = "endogenous_*"
    local instruments = "instrument_*"
    ivreghdfe outcome (`endogenous'=`instrument'), absorb(fe) savefirst
    In this case, how can I call estimates restore _ivreg2_ ? I am unsure what to write after _ivreg2_ to restore estimates. I have tried the name of the first endogenous variable and `endogenous', but both did not work. I also am not sure how I can check what the name is instead of just trying to guess it.

  • #2
    Code:
    sysuse auto , clear
    ivreghdfe price weight (length displacement=gear mpg), absorb(rep78) tol(1e-6) savefirst
    estimates dir
    estimates replay _ivreg2_length
    estimates replay _ivreg2_displacement
    estimates replay _ivreg2_*

    Comment


    • #3
      It works. I am having trouble with
      Code:
      estimates dir
      for some reason, but
      Code:
      estimates replay _ivreg2_*
      works fine. Thanks for your help!

      Comment

      Working...
      X