Announcement

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

  • Using instrumental variable in difference-in-difference model

    Code:
    xtreg outcome treated post did $controls i.year, fe vce(robust)
    By using the above fixed-effects model, I am estimating a difference-in-difference model. The variable "treated" is a dummy variable that is equal to 1 for the firms that are treated and 0 for firms that are not treated. This is a time-invariant variable, so this gets dropped when the fixed-effects model is estimated. The variable "post" is a dummy variable that is equal to 1 for the periods after the treatment occurs and 0 for the periods before the treatment occurs. "did" is an interaction term calculated by multiplying the treated dummy with the post dummy (treated * post). This approach is well-accepted in my research area, and the results make sense.

    Now, I have an instrumental variable (IV) for the treatment effect, and I would like to try testing whether this IV works and whether it helps to establish a stronger causal relationship in my theory. I have tried the following two ways of doing this, but I am not sure which of these two ways is more appropriate (or if they are both incorrect).

    The first way is instrumenting for the "treated" variable that gets dropped in a fixed-effects model. The coefficients do not change from the above difference-in-difference model, so I do not think this works, but I am including it here.
    Code:
    xtivreg outcome post did $controls i.year (treated = instrument), fe vce(robust)
    The second way is instrumenting for the "did" variable, which is the interaction term treated * post.
    Code:
    xtivreg outcome treated post $controls i.year (did = instrument), fe vce(robust)
    I would greatly appreciate it if anyone could point me in the right direction. Or, if there is something that I am doing wrong, I would really appreciate the guidance.
    Thank you in advance.

  • #2
    Seems to me that post should drop out too with i.year. With FE and i.year, the did variable should get you the DiD estimator. Also, I'd use c.treated#c.post rather than create did.

    I'm not sure that xtivreg can handle dichotomous endogenous regressors.

    Comment


    • #3
      Thank you for the note about whether xtivreg can handle dichotomous endogenous regressors. I will look more into this.

      For each treatment-control pair, the treatment period is different, so "post" does not drop out with i.year. Using c.treated#c.post gives me the same outcome.

      I am wondering how I can use an IV approach on top of this.

      Comment


      • #4
        You need to look into the methods for treatments that occur at different times. The 2way DD analysis is incorrect and xtivreg will not do the trick even if it could handle dichotomous treatments.

        look at csdid.

        Why do you think the treatment is endogenous? Normally we like to think of treatments as randomly assigned (or nearly so). Is this a selection problem or a simultaneity problem?

        Comment


        • #5
          I am using a staggered adoption of state law in the diff-in-diff, so the treatment (particular state law adoption) occurs at different times for different states. It is a pretty common setting in my field. I don't think the treatment is endogenous (i.e., extremely unlikely for firms in my sample to be affecting the adoption of this particular state law), but this state law adoption is not random either. I was thinking of adding an instrument for this state law adoption to account for this.

          I hope this makes sense. I will look into csdid and see if this is what I should be doing.

          Thank you.

          Comment


          • #6
            There is nothing wrong with applying IV when the endogenous variable is binary. The real issue is how you're handing heterogeneity. You can modify in the regression approach I discuss here:

            https://www.dropbox.com/sh/zj91darud...bgsnxS6Za?dl=0

            but you need a suitable instrument for all of the interaction terms. Is the intervention staggered without reversibility? What is the IV, and how does it vary over time? Also, you do not want "post" to vary by unit. That should be incorporated in the did variable. If you control for post you will wash out some of the treatment effect.

            Using a constant effects model isn't a bad starting point. There's been a lot made of the problems with it, but more often than not it gives a reasonable average of underlying treatment effect. The cases where it gives bizarre answers are not all that common, I think.

            Comment


            • #7
              Dear Prof. Wooldridge,

              I have the same question as Kyeonggook Park's. Indeed, my treatment variable is time-invariant and at the province level, as all firms are treated once in a year. My IV is also time-invariant.
              My model is as follows:

              Code:
              ivreghdfe lnemp1 $provincecontrol $pcicontrol2 age (c.firmtreat#c.post=c.iv#c.post) if inlist(year,2007,2008,2009), absorb(id year#isic4_2) cluster(clust) first
              The problem is I control for year*industry FE and time-varying province-level covariates in the second stage.These are also include in the first stage while firmtreat and iv are time-invariant. So it doesn't make sense to control for time-varying factors. Should I control for only province-level covariates of the treatment year in the first-stage? Or is there any other models that I can use for a DID with endogenous continuous treatment?

              Thank you for your attention to my question.
              Phuong
              Last edited by Phuongmh Le; 06 Nov 2023, 07:21.

              Comment

              Working...
              X