Announcement

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

  • Individual-fixed Effects in Difference-in-Difference Models

    Hello everybody,

    I recently read a paper that used individual-fixed (or plant-fixed) effects within a difference-in-difference (DiD) setting: see http://eml.berkeley.edu//~moretti/mdp2.pdf

    The econometric model is on page 22. They use a panel that includes plants and with a_p they incorporate plant-fixed effects.

    I thought, however, that it is not possible to use such fixed-effects within a DiD setting since the treatment dummy (i.e. winner) would cancel out.

    How would I implement such a model in Stata?

    Thank you very much in advance!

    Best regards,
    Sebastian

  • #2
    You are confused because the standard terminology for these models is inherently confusing. Let's go back to basics. First, forget about the fixed effects modeling and just talk about a DID model in a non-longitudinal data set.

    The basic model is one where we have a variable that indicates treatment group (0 for control, 1 for intervention), another one that indicates time before (0) or after (1) the intervention actually takes effect, and we incorporate an interaction term. So the basic code is:

    Code:
    regress /*or logit or whatever*/ outcome i.treatment##i.pre_post
    The output from this analysis will include coefficients for treatment, for pre_post, and for their interaction. While the conventional terminology is to refer to the output associated with a predictor variable as an "effect," we can see that this is confusing in this context. That is because the coefficient of treatment in this model is not the effect (in the causal or associative sense) of treatment on the outcome. Rather the coefficient of treatment represents the difference between the expected outcome in the treatment and control groups before the intervention. The actual or associative effect of treatment on outcome is given, instead, by the coefficient of the treatment#pre_post interaction term. In fact, the output associated with the treatment variable is typically ignored when interpreting these models--it is a nuisance parameter in the model. My point is that in "regression" terminology, that output is often called the "treatment effect", but it is not the actual causal or associative effect of treatment on the outcome.

    When we have longitudinal data and use a fixed effects regression the situation differs only in one respect: as you noted, the characterization of a plant (or individual, or whatever entity is the unit of analysis) as being in the intervention or control group does not vary over time. It is a fixed attribute of each entity, so it is collinear with the fixed effects in a longitudinal regression. Consequently, Stata (or any other statistics package) will drop the treatment variable from the model. So even though you write the command as:

    Code:
    xtreg /* or other xt command */ outcome i.treatment##i.pre_post, fe
    there will be no output for the treatment variable. It will be as if you programmed
    Code:
    xtreg outcome i.pre_post i.treatment#i.pre_post, fe
    But that is fine. As noted earlier, the treatment variable's coefficient is actually just a nuisance parameter in the model anyway. If it were available you wouldn't bother looking at it anyway. The "regression" treatment effect is of no importance. What you care about, and need to estimate, is the causal or associative effect of treatment on the outcome, and, just as in the non-longitudinal situation, that information is conveyed by the output for the treatment#pre_post interaction term.

    It would probably be better if a newer terminology were developed for discussing these models, but the existing terms are so entrenched in the literature and discourse, it is difficult to imagine a new and improved vocabulary for this taking hold.
    Last edited by Clyde Schechter; 05 Sep 2016, 13:04. Reason: Break up a very long run-on sentence.

    Comment


    • #3
      Thank you Clyde for your helpful the explanation. You refer to the coefficient of i.treatment as a nuisance parameter. However, couldn't the coefficient be interpreted as the effect that (time-invariant) unobserved heterogeneity has on the outcomes?

      As a further question: The authors of the aforementioned paper include, besides plant-fixed effects, industry-fixed effects. As I expect that firms stay in the same industry for the entire observation period, I suppose that it is not possible to simply write:

      Code:
       
       xtreg outcome i.pre_post i.treatment#i.pre_post i.industry, fe
      ...because i.industry would cancel out. Am I right here?

      If I understand the authors correctly, they do not just include industry-fixed effects but industry-fixed effects by year. How would the command look in Stata if I would like to combine plant-fixed effects with industry-fixed effects by year. Is this even possible? Would it be something like:

      Code:
      xtset plant_id
      xtreg outcome i.pre_post i.treatment#i.pre_post i.industry#i.year, fe
      Every comment is appreciated. Thank you in advance!

      Comment


      • #4
        The coefficient of the i.treatment variable is interpretable as the pre-intervention difference in expected outcome between the intervention and control groups. It is sometimes referred to concicsely as the "baseline difference between the groups." If there is some independent use for that statistic, that is fine. But its value is not normally of interest in a DID model. The DID model is indifferent to that baseline difference: its cardinal assumption is that whatever baseline difference there is would carry forward unchanged in the post-intervention period if the intervention did not occur. The only heterogeneity it measures is the between-groups difference prior to baseline.

        If, as you expect, and as makes sense to me, a firm stays in the same industry throughout the period of observation, then the industry effects will not be estimable and will be dropped due to colinearity with the firm fixed effects. But there are two other things I can think of that they might have done that might fit what you describe. One is that they may have used a random effects model rather than fixed effects. The other is that they may have -xtset industry- and then include i.plant_id in the covariates list of a fixed-effects regression. There still will be some colinearity and one plant_id will have to be omitted from the plant-effects within each industry, but the analysis will proceed. Or perhaps they had some other approach I haven't thought of. If the article doesn't make clear how they did this and it is important for you to know, then I think you need to inquire directly with the authors.

        The inclusion of industry-fixed effects would be almost as you describe, but subtly different:

        Code:
         
         xtreg outcome i.pre_post i.treatment#i.pre_post i.industry##i.year, fe
        The ## will expand into i.industry i.year and i.industry#i.year. The i.industry term will, of course, be omitted due to colinearity with the fixed effects. But the others will survive. The i.year variables are needed for a full representation of industry#year effects.

        Comment


        • #5
          Dear @Clyde Schechter, I am very sorry to bring you to this outdated post again. I have a similar question that I need your assistance with.

          I have a panel dataset and I am running a difference-in-difference model with time and unit fixed effects. I wonder if you think it is okay to have individual fixed effects if my main unit of analysis is at the individual level? Do this make any problem to the level of variation in the model? Thanks so much




          Comment


          • #6
            I wonder if you think it is okay to have individual fixed effects if my main unit of analysis is at the individual level?
            What other levels of variation are there in your data?

            Comment


            • #7
              Dear @Clyde Schechter,
              Thanks for your kind reply. I am not a 100% sure if I clearly get your questions, but to give more context, I am evaluating the impact of a conditional cash transfers that was implemented in 2015 on a set of socio-economic indicators such as child labor, child marriage, and female labour participation, among others. These conditional cash transfers are provided to households with children between 6-18 years.

              My data is a panel dataset with two pre-treatment periods (2006 and 2012) and one post-treatment period (2018). I have two binary indictors, the first is a dummy for treatment that takes 1 if an individual is treated, and 0 otherwise. Similarly, I have a dummy for time that takes the value of 1 if in treatment period (> 2015) and 0 otherwise.

              I am running a difference in difference design through the interactions of the terms treatment * time.

              I have different models specifications:
              - One without controls
              - One with controls at the household and individual levels.
              - One with time and individual fixed effects
              - Another one that has all specifications along with clusterings the standard errors at the household level given that the treatment assignment and sampling design were predominantly done at the household level.

              I wonder given this setting; do you think it is a good idea to have individual fixed effects? I am further considering assessing the heterogenous treatment effects for some of the significant DiD estimators, especially across regional level, and not sure if having a fixed effect with individuals' units would also be appropriate.

              I thank you so much for taking the time to reply to my message.

              Comment


              • #8
                Thanks for the clarification. This makes it much easier to answer. he levels of variation in your data are the household, the individual, and time. (Let's leave region out of it for now.)

                If this were a study in my area, epidemiology, we would probably not use a fixed effects model at all. The data is hierarchical, and we would use a multi-level model with random effects. We would include as many covariates ("control" variables) as we could reasonably measure and not run into overfitting problems in the hopes that the independence of the random effects would hold.

                But this looks like a study in economics, and that approach is frowned upon in favor of a fixed-effects model. In this situation, I would lean towards using individual fixed effects, but clustering errors at the household level (since the household was the unit of intervention.) I think the use of individual, rather than household, fixed effects is important here because if you use household level fixed effects you have no way of accounting for the variation at the individual level and you would be implicitly treating the individual responses within the same household as independent--which is unlikely to be the case. The use of individual fixed effects and clustered errors at the household level respects the individual level variation, and at least acknowledges, through clustering, both the role of the household as the unit of intervention and the non-independence of observations within households.

                I should add that all of this is based on the assumption that your outcome variables are ascertained at the individual level.

                All of that said, I have some concerns about other aspects of the model you described. The intervention was instituted in 2015 and applied to households with children between the ages of 6 and 18 years. But your post-intervention data doesn't begin until 2018. So there will be some individuals who had been treated for three years by the time you measure them. There will be other individuals who didn't "age in" to eligibility until 2016 or 2017 and will have only had two or one years of exposure to the payment. But the analysis you describe treats all of these as the same. And on the other side, there will be individuals who "aged out" between 2015 and 2017 and were thus exposed to the payment for a short time but are, in your design, classified as unexposed to the intervention, whereas they seem materially different from those who were never exposed to it. These look like difficulties with your design to me.

                Comment


                • #9
                  Dear @Clyde Schechter,
                  Thanks so much for your kind reply, I have no words to thank you enough!

                  With regards to the last point, I actually thought of that, but when double checking the main household questionnaire, the effect of the conditional transfer program was captured by asking the head of each sampled household whether they received the transfers during the 12-month period in 2018. This means that all individuals who replied with 'Yes' by that time were within the 6-18 age cohort. I therefore constructed by treatment dummy following that point. Do you think the issue you described still persists?

                  I have another question please if you don't mind, do you think it's a good idea to still look at the heterogenous treatment effect of some outcome variables even though their aggregate DiD results were not significant?
                  Thanks so much once again!

                  Comment


                  • #10
                    Well, your two questions are actually related.

                    The problem I raised in #8 is that those who say they received the transfers in 2018 are a heterogeneous group: some will have received them only in 2018, some will have received them in one or more of the other years since 2015. Similarly those who say that did not receive the transfers in 2018 are heterogeneous: some will never have received any transfers, and some will have received them in some or all of the years since 2015 but then became ineligible by 2018. While I am no expert in this field, it seems to me that the outcomes you are looking at are unlikely to respond instantly to the transfers. And I would also anticipate cumulative effects of several years of transfers. I would want a design to reflect this heterogeneity.

                    Of course, any attempt to look at heterogeneous effects requires a sufficiently large sample to support that kind of analysis. And I wouldn't let the aggregate DID results being non significant deter me from looking at subgroups (unless lack of power due to small sample size was part of the reason for the non-significant aggregate result). Indeed, it is possible that an aggregate null effect represents the cancellation of two important effects in opposite directions in subsets of the target population. If it seems plausible to you that such a situation could have happened, then you should go ahead and explore it, presuming you have a large enough data set. If, however, you think, for example, that it is only possible for the transfer payments to affect the outcomes in a single direction, then non such cancelling effects are possible, and such an analysis would not be worth pursuing.

                    Comment


                    • #11
                      Very much appreciated, thanks so much for the clarification and your kind support thus far!

                      Comment


                      • #12
                        Dear professor @Clyde Schechter,
                        My sincere apologies for the inconveniences. I just wanted to get your kind opinion on my estimates for the heterogenous treatment effects and whether what I have done thus far is considered valid, particularly with regards to the incorporation of two-way fixed effects in the model.

                        As a remainder, I am looking at the impact of a conditional cash transfer on various household welfare indicators. My regression includes a treatment dummy that takes 1 if treated and 0 otherwise, and time dummy that takes 1 if in post-treatment and 0 otherwise. The cash transfers are given at the household level, with individual being the main beneficiaries. The program was implemented in 2015. I am employing a difference-in-differences design.

                        One of the outcome variables I am exploring is female labour force participation rate, measured as the proportion of women between 15 and 64 who are actively engaged in labour force, whether currently employed or seeking employment, divided by the total female population under the same age bracket. I have developed this measure on Stata at the household level.

                        For the aggregate DiD model, I ran the following equation in stata:

                        reghdfe femlfpr i.time##i.treated2 $controls [pw=expan_indiv], vce(cluster hhid2) absorb(indid2 year)

                        For the heterogenous treatment, I would like to explore whether female labour force participation differs across regions and different levels of education attainment. For regions, for instance, the model is the same as above, with the exception of introducing a triple interaction to the DiD estimator as follow:

                        reghdfe femlfpr i.time##i.treated2##i.region $controls [pw=expan_indiv], vce(cluster hhid2) absorb(indid2 year)

                        I wonder once we add this sort of heterogeneity, do we need to account for different groups of fixed effects? For instance, I was thinking to incorporate region-time (interaction of year and region) fixed effects and individual fixed effects instead of just time and individual fixed effects, so that I can account for unobserved heterogeneity across regions over time (i.e., culture, traditions, etc.):

                        reghdfe femlfpr i.time##i.treated2##i.region $controls [pw=expan_indiv], vce(cluster hhid2) absorb(indid2 region_year)

                        Is this a valid thinking? Or do you think just keeping the same two-way fixed effects as the original model would still work fine in this sense?

                        Thanks so much for everything

                        Comment


                        • #13
                          Well, this is a complicated problem because you are trying to force a square peg into a round hole. You have data that is inherently multilevel: individuals nested within households, which are nested within regions. And, for all I know, there are other relevant levels in your data either between households and regions or above region. But you are trying to analyze it with a model, fixed effects, that is inherently limited to 2 levels.

                          In my discipline, we would most likely not use fixed-effects modeling for this, particularly if we have rich information about covariates ("control variables"). We would probably use a random effects model, perhaps even with random slopes. In economics and finance, however, such models are viewed with considerable suspicion. Assuming you wish to remain in the fixed-effects analysis world, you will see that any attempt to add region level fixed effects to the individual level effects fails, because, unless in your data people migrate among the regions during the period of observation, the region level fixed effects will be colinear with the individual level fixed effects and will be omitted. So you won't be able to do that.

                          I think the best compromise position, and the one that I think is most commonly used, for incorporating the region interaction, here would be to stick to absorbing the individual level fixed effects, but cluster the standard errors at the region level instead of the household level. That is, I would use -absorb(indid2 year) vce(cluster region)- instead of -absorb(indid2 year) vce(cluster hhid2)-. This would at least respect the non-independence of observations within region as well as the region being a level of analytic interest, and it would preserve the important individual and time fixed effects that are needed for the validity of the difference-in-differences estimator.

                          Comment

                          Working...
                          X