Announcement

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

  • CSDID with cross-sectional data and multicolinearity

    Hello everyone (@FernandoRios),

    I am using StataNow 19.5 (SE – Standard Edition) and would appreciate some guidance on how csdid handles covariates in a setting like mine.

    My dataset is cross-sectional, with approximately 13,000 observations. Each observation corresponds to one individual, and I observe their outcome in one of several survey years.

    My treatment is assigned at the cohort level, based on the year individuals entered school. I therefore use school-entry year as the time variable and the treatment cohort variable to identify when each cohort became exposed to the policy. The policy was adopted at different times across states (staggered adoption).

    My specifications are:

    TWFE:
    Code:
    reghdfe outcome treatment female age age2, absorb(state school_entry_year survey_year) cluster(state_school_entry_year)
    CSDID (version v1.8 br FRA. and v1.81 by Pedro Sant'Anna):
    Code:
    csdid outcome female age age2 survey_year_dummies, time(school_entry_year) gvar(treatment_year) cluster(state_school_entry_year) agg(simple)
    The variables are defined as follows:
    - Age: Age at the time the outcome is measured, calculated as survey year minus birth year.
    - Survey year: The year in which the outcome is measured.
    - School-entry year: Birth year + 6.
    - Treatment: A dummy indicating whether the individual is exposed to the policy.

    My question is: How does csdid handle multicollinearity among covariates?
    This is particularly relevant in my setting because age is mechanically determined by the survey year and school-entry year:
    Age = Survey year − School-entry year + 6.
    Therefore, age is perfectly collinear with the survey-year and school-entry-year fixed effects in the TWFE specification, and it is automatically dropped from the regression. However, when I include age as a covariate in csdid, the estimate changes: its magnitude decreases and it becomes statistically insignificant. Why does csdid not seem to drop age in the same way as TWFE? How does the estimator handle this relationship when incorporating covariates into the 2×2 comparisons?

    Why does csdid not seem to drop age in the same way as TWFE? Is this because the estimator handles covariates differently when constructing the 2×2 comparisons? More generally, how does csdid handle this?

    Thank you very much!
    Last edited by Ayisha Awol; 12 Nov 2026, 13:35.

  • #2
    I'm not entirely sure why csdid doesn't drop perfectly collinear variables, but it might help to try jwdid -- which is more like the reghdfe command you used but includes covariates fully flexibly -- to see what happens in that case.

    Comment


    • #3
      Hi Ayisha
      SO csdid will drop collinear variables, but the way those are dropped will depend on your setup.

      - you are right, csdid focuses on 2x2 designs. Specially with repeated crossection. (Actually, with repeated crossection only 2 regressions (rather than 4) are used for the ATT estimation)

      Now lets concentrate on a single regression. Say Post-treatment for the treated

      reg outcome female age age2 survey_year_dummies if school_entry_year == 2020 <- Example Here IF you were using year rather than year dummies, you are right, either age or survey_year would be dropped. Age2 will remain. WIth your specification, however, only 1 year dummy (or age) will be colinear. And in this case age2 will be collinear. But why is that a problem? Because if different models drop different variables when dropping collinear variables, the way ATTs are estimated will change slighly. What does this mean for you? You need to fix your specification. You cannot just add colinear variables in the model. F

      Comment


      • #4
        Originally posted by Jeff Wooldridge View Post
        I'm not entirely sure why csdid doesn't drop perfectly collinear variables, but it might help to try jwdid -- which is more like the reghdfe command you used but includes covariates fully flexibly -- to see what happens in that case.
        Thank you, Professor Wooldridge. I ran jwdid and it does drop the collinear covariates. The estimates are similar to my reghdfe results, just slightly higher.

        Originally posted by FernandoRios View Post
        Hi Ayisha
        SO csdid will drop collinear variables, but the way those are dropped will depend on your setup.

        - you are right, csdid focuses on 2x2 designs. Specially with repeated cross-section. (Actually, with repeated cross-section, only 2 regressions (rather than 4) are used for the ATT estimation)

        Now lets concentrate on a single regression. Say Post-treatment for the treated

        reg outcome female age age2 survey_year_dummies if school_entry_year == 2020 <- Example Here IF you were using year rather than year dummies, you are right, either age or survey_year would be dropped. Age2 will remain. WIth your specification, however, only 1 year dummy (or age) will be colinear. And in this case age2 will be collinear. But why is that a problem? Because if different models drop different variables when dropping collinear variables, the way ATTs are estimated will change slighly. What does this mean for you? You need to fix your specification. You cannot just add colinear variables in the model. F
        Thank you, Professor Rios. One follow-up question: Is there a way in csdid to see which covariates are kept in each 2×2?


        Thank you both!

        Comment


        • #5
          No directly on csdid. Because it runs many mini regressions, only keeping ATTs.
          However, you could use drdid (what runs on the background) use the same specification but for a specific 2x2 design, with the "detail" or noisy" options.
          that is a good excercise to replicate what csdid does, and look a bit under the hood.
          HTH
          F

          Comment


          • #6
            Originally posted by FernandoRios View Post
            No directly on csdid. Because it runs many mini regressions, only keeping ATTs.
            However, you could use drdid (what runs on the background) use the same specification but for a specific 2x2 design, with the "detail" or noisy" options.
            that is a good excercise to replicate what csdid does, and look a bit under the hood.
            HTH
            F
            Okay, thank you very much!

            Comment

            Working...
            X