Announcement

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

  • ivreghdfe, but use different clustered SE in the two stages

    I want to use the ivreghdfe command, but I want to use, say, Country clustered standard errors in the first stage and Industry clustered standard errors in the second stage. I couldn't figure out a way to do this. I want to avoid doing the two stages individually since I don't want to worry about manual adjustments to the var-covar matrix. Please advise.

  • #2
    Let's recap instrumental variable (IV) regression:

    \[\text{First stage: }X = \pi_0 + \pi_1 Z + \eta \]

    \[\text{Second stage: } Y = \beta_0 + \beta_1 \hat{X} + \varepsilon\]

    IV estimation uses the fitted values \( \hat{X} \) from the first stage to estimate the effect of \( X \) on \( Y \), isolating the exogenous variation attributable to the instrument \( Z \). Given this structure, it should be clear that clustering in the first stage alone is not particularly meaningful, since you are typically not making inference about \( \pi_1 \), and the fitted values \( \hat{X} \) are just intermediate inputs. What matters is that the second-stage standard errors correctly account for the residual correlation structure, particularly that induced by the instrument and any relevant clustering. This ensures valid inference about \( \beta_1 \).

    Comment


    • #3
      Thanks Andrew. I understand that fitted values are not affected by clustering choices. But I want to also show that \pi_1 is significant (at atmost 10%). The clustering choice for the second stage is leading to insignificance in the first stage. Further, I have some economic explanation for choosing a different clustering variable in the first stage vs the second stage. Hence, I wanted to know if there is some way to accomplish this without diving into var-covar matrix adjustments.

      Comment


      • #4
        The variance-covariance (VCV) matrix for the second-stage estimates is determined by the second-stage clustering, not the first-stage. If you want to display the first-stage results using a different clustering variable, simply replicate the first stage using reghdfe (from https://github.com/sergiocorreia/reghdfe).

        Comment


        • #5
          Got it. Thank you Andrew.

          Comment

          Working...
          X