Custom subset_fun for ptetools::pte that pulls
three time periods for each (g,t) cell: pre2, pre1 = g - anticipation - 1,
and post = tp. How pre2 is chosen depends on pre_copula:
"long" (default)pre2 = 2*(g - anticipation) - tp - 2, so
the copula-transfer window matches the event horizon e = tp - (g -
anticipation). Cells where this pre2 does not exist in the data return
empty data and panel_qtt_gt returns NA.
"short"pre2 = g - anticipation - 2 (fixed at treatment onset regardless of e).
For pre-treatment placebo cells (tp < g - anticipation), the base
always slides backwards regardless of pre_copula:
pre2 = tp - 2, pre1 = tp - 1. panel_qtt() sets
required_pre_periods = 2 so that the minimum tp in tlist
is the third period, guaranteeing tp - 2 is always a valid period.
three_period_subset(
data,
g,
tp,
control_group = "notyettreated",
anticipation = 0,
pre_copula = "long",
...
)A list with elements gt_data, n1, disidx.
A data frame prepared by ptetools::setup_pte.
The current group (first treatment period).
The current time period.
"notyettreated" (default) or
"nevertreated".
Number of periods of anticipation. Default 0.
"long" (default) or "short". See above.
Additional arguments; silently ignored.