*! version 1.0.0 11jul2026

Title

pididplot -- Graph the causal impact of a Path-Integrated
Difference-in-Differences (PI-DiD) analysis

Syntax

pididplot depvar [if] [in] ,
panelvar(varname)
timevar(varname)
treatvar(varname)
t0(#)
[t1(#) t2(#)
xtitle(string) title(string)
subtitle(string) name(string)
saving(filename) scheme(schemename)]

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 timevar

t2(#) intermediate rejoining date, marked with a reference
line, if the treated and control paths reconverge before t1

xtitle(string) shared x-axis title

title(string) overall graph title

subtitle(string) overall graph subtitle

name(string) name of the combined graph, passed to graph combine

saving(filename) save the combined graph to disk

scheme(schemename) graph scheme; default s2color

Description

pididplot draws a two-panel figure visualizing the causal impact
estimated by the pidid framework (Salavi, 2026):

1. Top panel -- the realized treated path c1(t) and the
counterfactual control path c0(t), with the area between them over
[t0, t1] shaded to represent the cumulative causal effect sigma.

2. Bottom panel -- the running (partial-sum) cumulative
effect sigma(t), computed by trapezoidal integration of tau(s) = c1(s) -
c0(s) from t0 up to each t. This panel makes the paper's central point
visible: sigma(t) rises while the paths are separated and then
plateaus once tau(t) decays back to zero, even though a static
endline comparison at t1 would report (approximately) zero effect.

A dashed reference line marks the final cumulative value sigma(t1) in the
bottom panel, and the note beneath it reports both the path-integrated
ATT and the conventional static endpoint DiD side by side, so the
divergence between the two is immediately visible.

pididplot does not itself return the numeric estimates in
r(); use pidid for that. Running pidid first (perhaps
with notable) and then pididplot on the same specification is
the recommended workflow.

Options

panelvar(varname), timevar(varname), treatvar(varname),
t0(#), t1(#) are defined exactly as in pidid.

t2(#) is purely a graphing aid: it draws an extra vertical
reference line at the rejoining date t2 (must satisfy t0 < t2 <= t1) so
the reader can see where the treated and control paths reconverge.

name(string), saving(filename), scheme(schemename),
title(), subtitle(), xtitle() are passed through to the
underlying graph combine call.

Examples

. pidid earnings, panelvar(id) timevar(time) treatvar(treat) t0(0) t1(5) notable

. pididplot earnings, panelvar(id) timevar(time) treatvar(treat) t0(0) t1(5) t2(5)

See example_pidid.do for a fully worked example that reproduces the
paper's Table 1 and its figure.

Also see

pidid