Announcement

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

  • Difference-in-difference and/or event-study on an unbalanced panel

    Hi everyone,

    I am working with an unbalanced individual-level panel from a survey and would appreciate some guidance on whether any of the staggered-adoption DiD estimators is appropriate in my setting. The panel spans up to 8 survey waves (which in the actual data correspond to calendar years), but it is far from balanced. Individuals may enter the survey after the first wave, and many respondents miss one or more intermediate waves. Treatment is an individual-level shock that occurs at different times for different individuals and is absorbing once it occurs. A simplified toy example is shown below:

    Code:
    * Example generated by -dataex-. To install: ssc install dataex
    clear
    input float(id time y shock gvar)
    1 1  9 0 0
    1 2  9 0 0
    1 3 11 0 0
    1 4 12 0 0
    1 5 11 0 0
    1 6 12 0 0
    1 7 12 0 0
    2 1  9 0 0
    2 2  9 0 0
    2 3  8 0 0
    2 4  9 1 4
    2 5  8 0 4
    2 6  7 0 4
    2 7  8 0 4
    2 8  9 0 4
    3 1 12 0 0
    3 2 12 0 0
    3 3 11 0 0
    3 4 13 0 0
    3 5 15 0 0
    3 6 14 1 6
    3 7 16 0 6
    3 8 16 0 6
    4 3 10 0 0
    4 4 10 0 0
    4 5 12 0 0
    4 6 12 0 0
    4 7 13 1 7
    4 8 14 0 7
    5 1 11 0 0
    5 2 13 0 0
    5 3 12 0 0
    5 4 12 0 0
    5 5 11 0 0
    5 8  9 0 0
    end
    Since this is clearly a staggered-adoption setting, I was considering estimators such as Callaway & Sant'Anna (e.g. csdid) or an event-study approach along the lines of Clarke and Tapia-Schythe (2020, eventdd). In fact, the "gvar" variable reported above is constructed to be used as the group variable in csdid. However, my understanding is that many of these implementations either require or strongly prefer a balanced panel structure.

    One idea I considered was constructing an alternative time variable based on the number of survey appearances for each individual. For example, I could keep only respondents observed e.g. 5 times and define a within-individual time index running from 1 to 5, regardless of the underlying survey year. This would create something closer to a balanced panel. However, my concern is that doing so would discard the calendar-time dimension, which seems important to track any time or cohort effects.

    Is there a standard way to handle this kind of unbalanced survey panel within the Callaway-Sant'Anna framework (or related estimators), or would the missing waves and staggered entry create identification problems that require a different approach? Any advice on how to proceed would be greatly appreciated!
    Last edited by Luna Diaz; 29 May 2026, 17:42.

  • #2
    Fernando Rios-Avila's command jwdid handles unbalanced panels without difficulty. In fact, it uses all available information -- unlike differencing approaches such as Callaway-Sant'Anna, which only uses an observation if both time periods are available. If you have covariates x1 ... xK, do the following:

    Code:
    jwdid y x1 ... xK, ivar(id) tvar(time) gvar(cohort) never
    estat event
    estat plot
    estat simple
    If you drop the "never" option, it produces the "lags only" version of the estimator. If you don't have covariates, just drop them from the command.

    Comment


    • #3
      Thank you, Jeff Wooldridge! I really appreciate your suggestion, as I was not aware of the jwdid command. I tried it on my actual dataset and it seems to be working well.

      I will now take a more in-depth look at the literature/documentation, in order to make sure I am not disregarding any assumption.

      Comment


      • #4
        Luna: The regression-based methods rely on the same kind of no anticipation and conditional parallel trends assumption as other estimators, including CS. The doubly robust estimators in csdid have some resilience to functional form, but it doesn't allow violation of PT in levels -- which to me is the most important limitation of linear models whether one uses csdid or jwdid.

        Comment


        • #5
          Keep the original calendar years. Renumbering interviews would put different calendar years in the same time period. Use gvar for the first date of absorbing treatment, with zero for never-treated respondents. In your example, shock marks the onset.

          Parallel trends alone is insufficient here. An unbalanced panel can show diverging group averages before treatment simply because different people answer each wave. Suppose respondents with persistently high outcomes leave the future-treated group. Its observed average falls even if everyone's outcome is flat. That is a composition effect, and the difference between observed cohort averages can then give the wrong picture of the population's trends. Our chained DiD paper spells out this formally: https://arxiv.org/abs/2301.01085. You may want to address selection on observables too, not just unit fixed-effects related composition, which is another feature of cdid.

          Unit fixed effects can absorb those permanent differences. If respondents also differ systematically in their outcome changes, the observation assumption becomes decisive. We built cdid for exactly this problem in panels with gaps, late entry, or attrition. The Stata package allows to use cohort-by-date preset to fit the linear unit and date fixed-effects specification discussed above. For a comparison with jwdid, align the sample, controls, reference period, and covariates. With your variable names, the never-treated comparison is:

          Code:
          cdid y, ivar(id) time(time) gvar(gvar) preset(cohort_time_fe) method(reg) baseperiod(universal) controlgroup(nevertreated)
          For the standard chained fit, omit preset(cohort_time_fe). Suppose one set of respondents supplies changes over years 1–2 and another over 2–3. cdid can combine the two to recover the longer effect when each comparison has cohort and eligible-control support and satisfies the parallel-trends and observation assumptions. It can do this even when nobody has a complete history. Run cdid_chain to see which comparisons identify each effect.

          The practical question for each link is whether the respondents observed at both dates represent their cohort in mean outcome changes. When they do so only among people with the same measured covariates, cdid can adjust with observation weighting, imputation of actual changes, or an augmented correction. That makes the extra assumption about missingness explicit and gives you a way to act on it.

          The guide walks through the diagnostics on incomplete data: https://www.davidbenatia.com/tools/c...e-missingness/

          Install from GitHub in Stata 19.5 (StataNow) or later, or from SSC.

          https://github.com/dvbn/cdid-stata
          Code:
          net install cdid, from("https://raw.githubusercontent.com/dvbn/cdid-stata/main")
          mata: mata mlib index

          Comment

          Working...
          X