| scm_placebo_x_cpp | R Documentation |
Covariate-spec counterpart of scm_placebo_cpp(): for each control unit,
treats it as pseudo-treated with its own predictor column X0[, i] and
fits the nested V/W optimisation against the remaining donors' predictors
X0[, -i], evaluating the prediction loss on pre-treatment outcomes.
Each leave-one-out problem is identical to a scm_weights_cpp() call on
the same submatrices; iterations are independent and run in parallel
under OpenMP.
scm_placebo_x_cpp(
X0,
Y_pre,
Y_post,
max_iter = 100L,
tol = 1e-04,
z_rows = NULL,
multistart = FALSE,
wolfe = FALSE
)
X0 |
Predictor matrix for control units (k x N_co), on the same
scale as the treated fit (SD-scaled when |
Y_pre |
Control pre-treatment outcomes (T_pre x N_co) |
Y_post |
Control post-treatment outcomes (T_post x N_co) |
max_iter |
Outer coordinate-descent iterations (default 100) |
tol |
Convergence tolerance for V updates (default 1e-4) |
z_rows |
Optional 1-based pre-period row indices of the outer
evaluation window (the |
multistart |
If |
wolfe |
If |
A list with:
mspe_pre: N_co-vector of pre-treatment MSPE per placebo unit
mspe_post: N_co-vector of post-treatment MSPE per placebo unit
effects: N_co-vector of mean post-period gap per placebo unit
gaps: (T_pre + T_post) x N_co matrix of placebo gap paths
A placebo unit whose solver fails yields NaN entries.
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.