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 |

`treated` |
A |

`donors` |
A |

`treatment` |
An integer. The period T' in which forecasting begins.
If |

`sc_est` |
A |

`tune_pars` |
A - m:
an integer representing the nearest neighbor estimator used. - min_preperiods:
an integer. The smallest number of estimation periods allowed in a fold used for cross-validation. We use all folds from fold `min_preperiods` up to the latest possible fold`treatment-2` .- set_f:
a `list` containing a single element, a vector of integers. Identifies the set of folds used for cross-validation. As above, each integer identifies a fold by the last time period it uses in estimation. E.g., set_f=c(7,8,9) would implement cross-validation using fold 7, fold 8, and fold 9.
If neither |

`cv_pars` |
A |

`nogurobi` |
A logical value. If true, uses LowRankQP to solve the synthetic control estimator,
rather than |

`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:

- phi_hat:
selected value for the model averaging parameter (1 is pure matching, 0 pure synthetic control).

- m_hat:
selected matching estimator (number of nearest neighbor).

- weights:
The vector length N containing weights placed on each control unit.

- pred.error:
The vector of treatment effects implied by the masc counterfactual, for periods T' to T.

- cv.error:
The average (weighted by

`weights_f`

) of the cross-validation errors generated by each fold.- cv.error.byfold:
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()`

Embedding an R snippet on your website

Add the following code to your website.

For more information on customizing the embed code, read Embedding Snippets.