Two criteria. "forward" holds out the last gap pre-shock waves, fits on
the H waves that precede them, and records the squared extrapolation error
at the held-out wave; it targets the design's own risk, extrapolation gap
waves ahead, and is computed for every feasible holdout position. "loo"
leaves one wave inside the window out at a time and predicts it from the
others (interpolation), as in the earlier applications.
Arguments
- data
A data frame of repeated cross-sections.
- outcome
Name of the outcome column. Categorical outcomes are expanded into one linear probability equation per level unless
continuous = TRUE.- onset
Onset year of the shock. Pre-shock waves are those strictly before it.
- grid
Candidate
Hvalues.- type
"forward"or"loo".- gap
For
"forward", number of waves held out between the training window and the predicted wave (1 = predict the next wave).- max_pre
For
"forward", use only themax_premost recent pre-shock waves as training and holdout material (default2 * max(grid)), so that the criterion describes extrapolation in the period near the shock rather than over the whole history of the survey.Infuses every pre-shock wave.- b
Age half-width; respondents aged
a - btoa + bare pooled.- ages
Integer vector of target ages.
- order
0 for the kernel-weighted mean, 1 for the local-linear extrapolant.
- kernel
Kernel over wave rank, see
cdd_kernel().- controls
Character vector of regression terms (e.g.
c("factor(race)", "educ")) entering the extrapolation additively.NULLfor none.- continuous
Logical; treat the outcome as continuous (single equation).
- levels
Optional subset of outcome levels to estimate.
- year, age, weight
Names of the survey-year, age, and survey-weight columns.
- ...
Further arguments passed to
cdd()for"forward".