Announcement

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

  • Omitted categories with fixed effects and clustering

    Hello,

    I am using a event study research design with a matched control group. I have a sample of 'treated' individuals observed over 7 years. Each individual has a unique matched 'control' individual observed over the same seven years. I am attempting to estimate an event study design where I include individual fixed effects and dummy variables for the year (omitting one year) interacted with the treatment group indicator. I have encountered an issue with specifying the omitted value of a categorical variable when estimating a regression with fixed effects and clustering standard errors at the match level (i.e. at the level pairs of individuals, one from the treatment group and one from the control group).

    When I cluster standard errors at the individual level, I obtain the estimates I hope for. When I change to cluster at the match level, Stata seems to 'override' my choice of omitted category.

    The following successfully selects the final year as the omitted category:

    xtreg y ib(last).year ib(last).year#ib(first).treated, fe i(individual_ID) vce(cluster individual_ID)

    However, when I change to cluster at the match level, Stata selects a different year as the omitted category in the interaction of year and the treatment group indicator. Whatever I do, I can't seem to get Stata to select the final category as the omitted category.

    xtreg y ib(last).year ib(last).year#ib(first).treated, fe i(individual_ID) vce(cluster match_ID)

    Where "individual_ID" in the individual-level identifier and "match_ID" is an identifier at the match level.

    In the case of the first regression, I get the message "note: 99b.year#1.treated omitted because of collinearity". This is fine as year 99 is the category I wish to be the reference category. In the second regression, I get the message "note: 1b.year#1.treated omitted because of collinearity". I don't know why this is now being treated as the omitted category.

    I am able to obtain the expected results by manually creating the dummy variables and therefore manually selecting the omitted group. However, I wish to obtain the expected results using a setup like that above because I am only able to export my results in certain formats because this analysis is run on a secure server and I can more easily export the analysis when the results are reported as coefficients on interacted categorical variables.

    Can anyone help me please? I can't include the full Stata output as this is run on a secure server.

    Thank you in advance.
    David
    Last edited by David Sturrock; 17 May 2022, 10:54.

  • #2
    Various versions of this question come up from time to time. The issue is that you are trying to specify interactions without including all the main effects, in your case "i.treated". The proper way would be

    Code:
    xtreg y ib(last).year##ib(first).treated, fe i(individual_ID) vce(cluster match_ID)

    If you are convinced that you do not need the coefficient on the treated indicator, see https://www.statalist.org/forums/for...nuous-variable

    Comment

    Working...
    X