Announcement

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

  • IV regressions with interaction terms

    Dear Stata community,

    I'd like to run an IV regression with interaction terms between the endogenous variable and two other variables to study heterogeneous treatment effects, suppose x1 is the endogenous variable, z is the instrument, x2 and x3 are the two variables to be interacted with x1; x1_x2, x1_x3, z_x2 z_x3 are interactions between x1 and x2, x1 and x3, z and x2, and z and x3, respectively, I'd also like to use ivreghdfe to control for fixed effects. I was wondering if the following code is correct:

    ivreghdfe y (x1 x1_x2 x1_x3 = z z_x2 z_x3) x2 x3, a(fe1)

    More specifically, I'd like to ask is it right to write the code for instrumenting as (x1 x1_x2 x1_x3 = z z_x2 z_x3)?

    Thanks,
    Yi

  • #2
    Yes, what you have done is correct.

    Comment


    • #3
      One word of caution: Depending on how x2 and x3 are measured, you may get strange estimates on x1, as it will be the effect with x2 = x3 = 0. That's often not interesting and sometimes impossible. If x2 and x3 do not take zero as a realistic value then you might want to center them first before interacting with x1.

      Comment


      • #4
        Thank you both Joro and Jeff. I'd like to ask Jeff a follow-up question: thank you for suggesting demeaning x2 and x3, I will apply that. In case I misunderstood, I was wondering if you agree that this instrumenting code is correct: ivreghdfe y (x1 x1_x2 x1_x3 = z z_x2 z_x3) x2 x3, a(fe1)?

        Comment


        • #5
          Yes. You may find reason to cluster your standard errors depending on the particulars.

          Comment


          • #6
            Thanks Jeff! And yes, in my setting, I need to cluster standard errors.

            Comment


            • #7
              Dear all,

              Jeff Wooldridge

              I have a question regarding the heterogeneous treatment effects. For example, I want to estimate the heterogeneous treatment effects of informal caregiving on caregivers' health by household income. Let y denote the binary health outcome (1=good; 0=poor), CG is the caregiving status (1=caregivers; 0 otherwise), Z1 and Z2 are instrumental variables for CG and are measured as binary ones, HHinc is a binary indicating whether the HH is rich or poor (1=rich; 0 otherwise), I also have age and edu as additional covariates.

              As my primary purpose is to estimate the heterogeneous treatment effects by HH income, so I am thinking of two approaches but not sure which one is better. You advice would be highly appreciated.

              The first approach is similar to post #1, that is:
              Code:
              ivreg2 y (CG i.CG#i.HHinc = Z1 Z2 i.Z1#i.HHinc i.Z2#i.HHinc) age edu HHinc, robust
              In the second approach, I just run regression separately for the two HH income groups
              Code:
              ivreg2 y (CG = Z1 Z2) age edu if HHinc==0, robust
              ivreg2 y (CG = Z1 Z2) age edu if HHinc==1, robust
              Thank you
              Last edited by Matthew Williams; 31 Aug 2021, 08:00.

              Comment


              • #8
                Hello again,

                Let me add a question, what is the intuition behind the interaction terms in post #1? The author of this topic interacted x1 with both x2 and x3 and then s/he did the same things for variable z. I would highly appreciate it if anyone can explain the intuition behind to me.

                Thank you.

                Comment

                Working...
                X