Model is initiated with a list of parameters most which include treated_units and donor_units, two dataframes that contain time periods, units, and counts of outcomes
new()
ElasticSynth$new( treated_units, donor_units, measure_vars, measure_col, unit_col, time_col, value_col, pre_list, post_list, start_cv_list, end_cv_list, cv_step_list, start_month_list, end_month_list, time_unit_list, alphas = NULL, lambdas = NULL, lower_limit_weights, upper_limit_weights, placebo, verbose, max_pre_month, end_month, start_month )
treated_units
Treated units data.frame
donor_units
Donor units data.frame
measure_vars
Outcome measures upon which to jointly fit a synthetic control
measure_col
Column name for measure_vars
unit_col
Column name for unit information
time_col
Column name for time information (in form 1:max(time))
pre_list
A list of lists or vectors representing pre periods across all outcomes
post_list
A list of lists or vectors representing post periods across all outcomes
start_cv_list
A list indicating where to start CV procedure in time
end_cv_list
A list indicating where to end CV procedure in time
time_unit_list
A list indicating the time between time periods
alphas
vector of alphas to use for cross validation - for more information see glment
cv_treated()
ElasticSynth$cv_treated()
cv_untreated()
ElasticSynth$cv_untreated()
cv()
ElasticSynth$cv(type)
generate_weights()
ElasticSynth$generate_weights(cv_results)
fit()
ElasticSynth$fit(weights, cv_results)
plot()
ElasticSynth$plot(series_frame)
generate_hyndman_folds()
ElasticSynth$generate_hyndman_folds(start_cv, end_cv, cv_step)
long_to_wide()
ElasticSynth$long_to_wide(dt, time_col, unit_col, value_col)
time_col
Column name for time information (in form 1:max(time))
unit_col
Column name for unit information
long_to_wide_weights()
ElasticSynth$long_to_wide_weights( dt, pre_list, time_col, unit_col, measure_col, value_col, fitted_vars )
pre_list
A list of lists or vectors representing pre periods across all outcomes
time_col
Column name for time information (in form 1:max(time))
unit_col
Column name for unit information
measure_col
Column name for measure_vars
clone()
The objects of this class are cloneable with this method.
ElasticSynth$clone(deep = FALSE)
deep
Whether to make a deep clone.
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.