*! version 1.0.0 15jul2026

Title

pathintdidrobust -- Robustness checks and specification tests for Path-Integrated Difference-in-Differences (PI-DiD)

Syntax

pathintdidrobust depvar [if] [in] ,
panelvar(varname)
timevar(varname)
treatvar(varname)
t0(#)
[t1(#) level(#) maxanticip(#) notable]

Required
panelvar(varname) unit (id) identifier

timevar(varname) calendar/period variable

treatvar(varname) time-invariant 0/1 treatment-group indicator

t0(#) baseline period (start of the post-treatment window)

Optional
t1(#) evaluation horizon (endline); default is the maximum
observed value of timevar

level(#) confidence level for reported intervals; default
is level(95)

maxanticip(#) maximum number of pre-treatment grid points by
which the reference baseline is shifted back when building the
anticipation-robustness sensitivity curve; default is maxanticip(0)
(check (C) skipped)

notable currently unused; reserved for future use

Description

pathintdidrobust is the companion diagnostic command to
pathintdid and implements the three robustness checks and
specification tests described in section 5 of the companion paper
(Salavi 2026). All three diagnostics operate on the same estimand,
sigma = INTEGRAL_t0^t1 tauhat(t) dt, and the same cluster-robust,
individual-level standard errors as pathintdid itself, so results
from the two commands are directly comparable.

(A) Dynamic placebo test for pre-treatment parallel trends. Using
whatever survey waves are recorded before t0(), pathintdidrobust
computes the pre-treatment cumulative envelope

sigma_pre = INTEGRAL_^ tauhat(t) dt

together with its standard error (a "PCE" Z-test of H0: sigma_pre = 0),
and a joint Wald test of H0: tau_pre = 0 across all P pre-treatment
gaps, using the same group-specific covariance construction as the main
estimator. If no wave is recorded before t0(), this check reports
a note and is skipped -- it is not silently omitted.

(B) Sensitivity to grid density and quadrature scheme. Because
sigma-hat is a trapezoidal-rule approximation to a continuous integral,
pathintdidrobust recomputes it on a coarsened grid that keeps only
every second post-treatment survey wave (K/2 intervals instead of K) and
also computes Simpson's 1/3 rule estimate on the original grid. Large
discrepancies between the trapezoidal and Simpson estimates suggest that
tau(t) has curvature not well captured by the path-smoothness assumption
of the companion paper, and that a finer survey grid would improve
estimation. This check requires an even number of equally spaced
post-treatment intervals between t0() and t1(); otherwise it
reports a note and is skipped.

(C) Anticipation-robust bounding estimator. If individual units
anticipate the intervention, potential outcomes can start to diverge
before the nominal baseline t0(), biasing sigma-hat. For each
delta = 0, 1, ..., maxanticip() pre-treatment grid points,
pathintdidrobust shifts the reference baseline back to t0-delta and
recomputes

sigma-hat(delta) = INTEGRAL_^ tauhat_delta(t) dt

with its own standard error and confidence interval, and reports whether
the sign of the cumulative effect is robust across the full sensitivity
curve. If it is not, pathintdidrobust reports the conservative,
model-free bounds [min_delta sigma-hat(delta), max_delta sigma-hat(delta)]
for the true cumulative effect. This check also requires at least one
pre-treatment wave and is skipped, with a note, when none is available.

As with pathintdid, checks (A) and (C) require at least two treated
and two control units with a complete trajectory across the relevant
grid; when this fails, pathintdidrobust reports point estimates
only (check (A)) or marks the corresponding row "(not identified)"
(check (C)), rather than stopping with an error.

Options

panelvar(varname), timevar(varname), treatvar(varname),
t0(#), t1(#), and level(#) have the same meaning as in
pathintdid.

maxanticip(#) sets the number of pre-treatment grid points over
which the anticipation-robustness sensitivity curve of check (C) is
computed. The command uses min(maxanticip(), P), where P is the
number of pre-treatment waves actually observed in the data. The default,
maxanticip(0), skips check (C) entirely (checks (A) and (B) are
always attempted).

notable is accepted for syntax symmetry with pathintdid but
currently has no effect (the diagnostic output of pathintdidrobust
is not a single c0(t)/c1(t)/tau(t) table and is not suppressed by this
option).

Stored results

pathintdidrobust stores the following in r(). Scalars
attached to a given check are returned only when that check actually
runs (i.e., not skipped for lack of pre-treatment data or an
even/equally-spaced post-treatment grid).

Check (A): dynamic placebo test

r(P_pre) number of pre-treatment waves found (0 if none)

r(sigma_pre) pre-treatment cumulative envelope

r(se_sigma_pre) standard error of r(sigma_pre)

r(Z_pre), r(p_Z_pre) PCE Z-test and its p-value

r(W_pre), r(df_pre), r(p_Wald_pre) joint Wald test, its df, and p-value

Check (B): grid-density/quadrature sensitivity

r(K_grid) number of post-treatment intervals used

r(sigma_K) trapezoidal estimate on the full grid

r(sigma_Khalf) trapezoidal estimate on the half-density grid

r(sigma_Simpson) Simpson's 1/3-rule estimate on the full grid

Check (C): anticipation-robust bounding estimator

r(anticip_mmax) number of anticipation horizons actually used

r(anticip_min), r(anticip_max) min/max of sigma-hat(delta) across horizons

r(anticipation_table) matrix with one row per delta and columns
sigma-hat(delta), se, CI lower, CI upper

Examples

Setup: the same 20-unit training-program panel used to illustrate
pathintdid.

. use trainingpanel, clear

Full robustness suite, allowing the anticipation-robustness curve
to shift the baseline back by up to two pre-treatment grid points:

. pathintdidrobust consumption, panelvar(id) timevar(time) treatvar(treat) t0(0) t1(4) maxanticip(2)

In the bundled trainingpanel.dta, the earliest recorded wave is
time == 0, which is exactly t0(); there are no pre-treatment
survey rounds on file, so checks (A) and (C) correctly report that no
pre-treatment data are available and skip themselves -- this is expected
behavior, not an error. Check (B), which does not require pre-treatment
waves, compares the full-grid, half-grid, and Simpson estimates of
sigma over [0,4] (an even, equally spaced 4-interval grid).

Requesting the same checks over the full [0,5] window, where the
number of post-treatment intervals (K=5) is odd, demonstrates that check
(B) reports a note and is skipped rather than silently using an invalid
grid:

. pathintdidrobust consumption, panelvar(id) timevar(time) treatvar(treat) t0(0) t1(5) maxanticip(2)

References

Salavi, C. A-F. 2026. "Path-Integrated Difference-in-Differences (PI-DiD):
Identification, Estimation, and Inference for Cumulative Treatment
Effects." Working paper, African School of Economics.

Also see

pathintdid

pathintdidplot