Description Usage Arguments Value References See Also
View source: R/crossvalidation.R
Implements the matching and synthetic control (masc) estimator of Kellogg, Mogstad, Pouliot, and Torgovitsky (2019), conditional on a given matching estimator characterized by m. masc loops over evaluations of this function for each candidate matching estimator, and selects the one which minimizes cross-validation error.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 | cv_masc(
treated,
donors,
treated.covariates = NULL,
donors.covariates = NULL,
treatment = NULL,
sc_est = sc_estimator,
match_est = NearestNeighbors,
tune_pars = list(min_preperiods = NULL, set_f = NULL, m = NULL, weights_f = NULL,
matchVfun = NULL),
cv_pars = list(forecast.minlength = 1, forecast.maxlength = 1),
phival = NULL,
...
)
|
tune_pars |
A
#' If neither |
cv_pars |
A |
phival |
A real value between 0 and 1. If specified, hard-codes the masc estimator to take the specified weighted
average of matching and synthetic controls, where |
returns a list containing five objects:
selected value for the model averaging parameter (1 is pure matching, 0 pure synthetic control).
selected matching estimator (number of nearest neighbor).
The vector length N containing weights placed on each control unit.
The vector of treatment effects implied by the masc counterfactual, for periods T' to T.
The average (weighted by weights_f
) of the cross-validation errors generated by each fold.
The cross-validation error generated by each fold.
Kellogg, M., M. Mogstad, G. Pouliot, and A. Torgovitsky. Combining Matching and Synthetic Control to Trade off Biases from Extrapolation and Interpolation. Working Paper, 2019.
Other masc functions:
masc_by_phi()
,
masc()
,
sc_estimator()
,
solve_masc()
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.