Papers
Topics
Authors
Recent
Search
2000 character limit reached

Functional Data Approach to DiD

Updated 14 December 2025
  • The paper introduces a functional framework that models outcome trajectories as elements in a Banach space, enabling uniform inference over time.
  • It employs double-demeaning and a functional CLT to yield estimators converging to Gaussian processes, allowing honest simultaneous confidence bands.
  • Practical applications, such as studies on gender bias and employment, validate its superiority in handling parallel trends violations and anticipation effects.

The functional data approach to Difference-in-Differences (DiD) reframes the standard discrete-time panel event study within a continuous-time, infinite-dimensional stochastic process framework. Each unit’s outcome trajectory is modeled as a random element in the Banach space of continuous functions, enabling rigorous simultaneous causal inference over time intervals, not just at isolated points. This paradigm, introduced by Fang & Liebl (Fang et al., 7 Dec 2025), replaces conventional pointwise inference with uniform functional inference, directly addressing limitations in common event study plots where the parallel trends and no-anticipation assumptions may be violated. The approach yields estimators that converge to Gaussian processes, supports construction of honest simultaneous confidence bands (SCBs), and enables principled equivalence and relevance testing across intervals—transforming event study plots into comprehensive causal inference tools.

1. Functional Data Framework

Let each observational unit i=1,,ni=1,\ldots,n generate an outcome trajectory Yi()Y_i(\cdot) as a function in C[Tpre,Tpost]C[-T_{\text{pre}},T_{\text{post}}], but only discrete-time samples Yi,t=Yi(t)Y_{i,t}=Y_i(t) for t{Tpre,,Tpost}t\in\{-T_{\text{pre}},\ldots,T_{\text{post}}\} are observed. Each unit is assigned a post-treatment indicator Di{0,1}D_i\in\{0,1\}, so that observed outcomes follow the potential outcome model:

Yi(t)=DiYi(t,1)+(1Di)Yi(t,0)Y_i(t) = D_i\,Y_i(t,1) + (1-D_i)\,Y_i(t,0)

where Yi(t,d)Y_i(t,d) denotes the potential outcome under treatment status dd. The canonical event-study DiD parameter process is defined as:

β(t):=E[Yi(t)Yi(0)Di=1]E[Yi(t)Yi(0)Di=0],t[Tpre,Tpost]\beta(t) := \mathbb{E}[Y_i(t)-Y_i(0)\mid D_i=1] - \mathbb{E}[Y_i(t)-Y_i(0)\mid D_i=0], \quad t\in [-T_{\text{pre}}, T_{\text{post}}]

with β(0)=0\beta(0)=0 by construction.

Under standard DiD assumptions:

  • No anticipation: E[Yi(0,1)Yi(0,0)Di=1]=0\mathbb{E}[Y_i(0,1)-Y_i(0,0)\mid D_i=1]=0
  • Parallel trends: E[Yi(t,0)Yi(0,0)Di=1]=E[Yi(t,0)Yi(0,0)Di=0]\mathbb{E}[Y_i(t,0)-Y_i(0,0)\mid D_i=1]=\mathbb{E}[Y_i(t,0)-Y_i(0,0)\mid D_i=0] for all tt
  • Overlap: ϵ<P(Di=1)<1ϵ\epsilon < P(D_i=1) < 1-\epsilon for some ϵ>0\epsilon>0

it follows that β(t)=E[Yi(t,1)Yi(t,0)Di=1]θATT(t)\beta(t) = \mathbb{E}[Y_i(t,1)-Y_i(t,0)\mid D_i=1] \equiv \theta_{\text{ATT}}(t), the average treatment effect on the treated at each tt.

To handle unit and time fixed effects, the model employs “double-demeaning” in ii and tt, resulting in the oracle regression

Y¨i(t)=γ(t)D˙i+ε¨i(t)\ddot Y_i(t) = \gamma(t)\,\dot D_i + \ddot \varepsilon_i(t)

where D˙i=DiDˉ\dot D_i = D_i - \bar D, γ(t)=β(t)+const\gamma(t) = \beta(t) + \text{const}, and ε¨i(t)\ddot\varepsilon_i(t) is a mean-zero error process in C[Tpre,Tpost]C[-T_{\text{pre}},T_{\text{post}}].

The least-squares estimator for β(t)\beta(t) is constructed as

β^n(t)=(1ni=1nD˙i2)1(1ni=1nD˙i[Y˙i(t)Y˙i(0)])\hat\beta_n(t) = \left( \frac{1}{n}\sum_{i=1}^n\dot D_i^2 \right)^{-1} \left( \frac{1}{n}\sum_{i=1}^n \dot D_i\,[\dot Y_i(t)-\dot Y_i(0)] \right)

with β^n(0)=0\hat\beta_n(0)=0, Y˙i(t)=Yi(t)n1i=1nYi(t)\dot Y_i(t) = Y_i(t) - n^{-1}\sum_{i=1}^n Y_i(t).

Regularity conditions include independence of (Yi(),Di)(Y_i(\cdot),D_i), bounded higher moments E[Y(t)4]<\mathbb{E}[Y(t)^4]<\infty, E[D4]<\mathbb{E}[D^4]<\infty, E[Y()2]<\mathbb{E}[\Vert Y'(\cdot)\Vert_\infty^2]<\infty, E[Y()2]<\mathbb{E}[\Vert Y(\cdot)\Vert_\infty^2]<\infty, and twice-continuous differentiability of ϕ\phi, εi\varepsilon_i, β\beta, and CβC_\beta.

2. Uniform Central Limit Theorem and Gaussian Process Limit

The estimator β^n\hat\beta_n constitutes a stochastic process indexed by tt in C[Tpre,Tpost]C[-T_{\text{pre}},T_{\text{post}}], furnished with the sup-norm \Vert \cdot \Vert_\infty. The population covariance kernel is given by:

Cβ(s,t)=E[D˙2(ε(s)ε(0))(ε(t)ε(0))]E[D˙2]2C_\beta(s,t) = \mathbb{E}\left[\dot D^2\,(\varepsilon(s)-\varepsilon(0))\,(\varepsilon(t)-\varepsilon(0))\right]\,\mathbb{E}[\dot D^2]^{-2}

Under the stated regularity conditions, the following functional CLT holds:

n{β^n()β()}GP(0,Cβ(,))in (C[Tpre,Tpost],)\sqrt{n}\{\hat\beta_n(\cdot) - \beta(\cdot)\} \Rightarrow GP\left(0, C_\beta(\cdot,\cdot)\right) \quad \text{in}\ (C[-T_{\text{pre}},T_{\text{post}}],\Vert\cdot\Vert_\infty)

The formal proof comprises three components:

  • Pointwise CLTs at each tt,
  • Equicontinuity bounds via C2^2-smoothness,
  • Application of functional CLT machinery (Pollard 1984; Hahn 1977; Billingsley).

No-anticipation and parallel trends are not required for this functional CLT.

3. Honest Simultaneous Confidence Bands

From the Gaussian process limit, simultaneous confidence bands in sup-norm covering are constructed as:

SCB1αsup(t)=[β^n(t)±u1α/2supC^β(t,t)/n]\text{SCB}^{\text{sup}}_{1-\alpha}(t) = \left[\, \hat\beta_n(t) \pm u^{\text{sup}}_{1-\alpha/2}\sqrt{\widehat{C}_\beta(t,t)/n}\,\right]

for tt in the post-treatment window [0,Tpost][0,T_{\text{post}}]. The critical value u1α/2supu^{\text{sup}}_{1-\alpha/2} is calibrated such that

P{supt[0,Tpost]Tn(t)>u1α/2sup}α/2\mathbb{P}\left\{\sup_{t\in[0,T_{\text{post}}]}|T_n(t)| > u^{\text{sup}}_{1-\alpha/2} \right\}\approx\alpha/2

where Tn(t)=n(β^n(t)β(t))/C^β(t,t)T_n(t) = \sqrt{n}\,(\hat\beta_n(t)-\beta(t))/\sqrt{\widehat{C}_\beta(t,t)}.

Calibration approaches include:

  • Parametric (Gaussian) bootstrap: Simulating GP samples N(β^n,C^β/n)N(\hat\beta_n,\widehat{C}_\beta/n) at the grid, spline interpolation, and quantile computation.
  • Multiplier bootstrap: Reweighting residuals by i.i.d. weights and recomputing estimators.
  • Kac-Rice formula: Closed-form quantile approximation utilizing covariance curvature traces (Liebl–Reimherr 2023).

Uniform coverage is guaranteed asymptotically:

limnP{β()SCB1αsup() for any t[0,Tpost]}α\lim_{n\to\infty}\mathbb{P}\{ \beta(\cdot)\notin \text{SCB}^{\text{sup}}_{1-\alpha}(\cdot)\ \text{for any}\ t\in[0,T_{\text{post}}] \}\leq\alpha

4. Equivalence Testing for Pre-Anticipation Window

Suppose a reference band [Δ(t),Δu(t)][\Delta_\ell(t), \Delta_u(t)] for Δ(t)=β(t)\Delta(t)=\beta(t) is postulated under a compound null H0:β(t)=Δ(t)H_0:\beta(t)=\Delta(t) for t[Tpre,tA]t\in[-T_{\text{pre}},t_A], with tA0t_A\leq0 defining the anticipation window’s start. The test distinguishes:

  • H0H_0: t[Tpre,tA]\exists\, t\in[-T_{\text{pre}},t_A] such that β(t)[Δ(t),Δu(t)]\beta(t)\notin [\Delta_\ell(t),\Delta_u(t)]
  • H1H_1: t[Tpre,tA]\forall\, t\in[-T_{\text{pre}},t_A], β(t)[Δ(t),Δu(t)]\beta(t)\in [\Delta_\ell(t),\Delta_u(t)]

Infimum SCBs are constructed:

SCB1αinf,+(t)=[,β^n(t)+u1αinfC^β(t,t)/n]\text{SCB}^{\text{inf},+}_{1-\alpha}(t) = [-\infty, \hat\beta_n(t)+u^{\text{inf}}_{1-\alpha}\sqrt{\widehat{C}_\beta(t,t)/n}]

SCB1αinf,(t)=[β^n(t)u1αinfC^β(t,t)/n,]\text{SCB}^{\text{inf},-}_{1-\alpha}(t) = [\hat\beta_n(t)-u^{\text{inf}}_{1-\alpha}\sqrt{\widehat{C}_\beta(t,t)/n},\infty]

Reject H0H_0^- (“t:β(t)Δ(t)\exists t:\beta(t)\leq\Delta_\ell(t)”) if Δ(t)<SCB1αinf,(t)\Delta_\ell(t)<\text{SCB}^{\text{inf},-}_{1-\alpha}(t) t\forall t; reject H0+H_0^+ (“t:β(t)Δu(t)\exists t:\beta(t)\geq\Delta_u(t)”) if SCB1αinf,+(t)<Δu(t)\text{SCB}^{\text{inf},+}_{1-\alpha}(t)<\Delta_u(t) t\forall t.

A joint 2α2\alpha-level test requires both bands to be contained within [Δ(t),Δu(t)][\Delta_\ell(t), \Delta_u(t)] t\forall t. The test enjoys asymptotic size α\alpha via the functional CLT and consistent covariance estimation.

5. Relevance Testing for Post-Treatment Effects

A parallel relevance test is formulated for the post-treatment window using the same reference band:

  • H0H_0: β(t)[Δ(t),Δu(t)]\beta(t)\in [\Delta_\ell(t),\Delta_u(t)] t(0,Tpost]\forall t\in(0,T_{\text{post}}]
  • H1H_1: t:β(t)[Δ(t),Δu(t)]\exists t:\beta(t)\notin [\Delta_\ell(t),\Delta_u(t)]

Rejection occurs if the supremum confidence band SCB1αsup(t)\text{SCB}^{\text{sup}}_{1-\alpha}(t) fails to intersect [Δ(t),Δu(t)][\Delta_\ell(t),\Delta_u(t)] for any tt. This test holds asymptotic size α\alpha.

6. Empirical Validation and Applications

Simulation results indicate:

  • Interpolation error decays at rate OP(1/n)+O(1/T)O_P(1/\sqrt{n}) + O(1/T).
  • Under parallel-trends violations, sup-SCB tests maintain nominal Type I error control and exhibit higher detection power than Bonferroni-corrected pointwise bands, which are invalid.
  • Under anticipation, inf-SCB equivalence tests control size when the reference band coincides with β\beta during [Tpre,tA][-T_{\text{pre}},t_A] and demonstrate power against mis-specified bands.

Case studies demonstrate robust practical utility:

  • For gender bias in livestreamed courts (Chen et al 2025), the honest event study plot first validates the reference band via infimum-SCB over t1t\leq -1 and then confirms significant uniform post-period effects over [5.5,9][5.5,9] via supremum-SCB.
  • For duty-to-bargain laws and female employment (Lovenheim & Willén 2019), the reference band could not be rigorously validated (inf-SCB intersects band), yet the post-treatment sup-band fails to reject the null, indicating no significant causal effect once pre-trend is accommodated.

7. Software Implementation

The R package fdid (fang_liebl_2025_R) operationalizes the functional DiD approach by:

  1. Fitting the functional DiD estimator via TWFE.
  2. Performing natural-cubic-spline interpolation.
  3. Estimating the covariance surface.
  4. Computing sup- and inf-SCBs through parametric, multiplier, or Kac-Rice procedures.
  5. Executing relevance and equivalence tests.
  6. Rendering “honest” event-study plots.

This comprehensive workflow provides transparent, uniform inference for causal effects over time, rectifying deficiencies inherent in pointwise event study analysis (Fang et al., 7 Dec 2025).

Definition Search Book Streamline Icon: https://streamlinehq.com
References (1)

Topic to Video (Beta)

No one has generated a video about this topic yet.

Whiteboard

No one has generated a whiteboard explanation for this topic yet.

Follow Topic

Get notified by email when new papers are published related to Functional Data Approach to DiD.