ElasticSynth: ElasticSynth - a class for running synthetic controls with...

Description Methods

Description

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

Methods

Public methods


Method new()

Usage
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
)
Arguments
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


Method cv_treated()

Usage
ElasticSynth$cv_treated()

Method cv_untreated()

Usage
ElasticSynth$cv_untreated()

Method cv()

Usage
ElasticSynth$cv(type)

Method generate_weights()

Usage
ElasticSynth$generate_weights(cv_results)

Method fit()

Usage
ElasticSynth$fit(weights, cv_results)

Method plot()

Usage
ElasticSynth$plot(series_frame)

Method generate_hyndman_folds()

Usage
ElasticSynth$generate_hyndman_folds(start_cv, end_cv, cv_step)

Method long_to_wide()

Usage
ElasticSynth$long_to_wide(dt, time_col, unit_col, value_col)
Arguments
time_col

Column name for time information (in form 1:max(time))

unit_col

Column name for unit information


Method long_to_wide_weights()

Usage
ElasticSynth$long_to_wide_weights(
  dt,
  pre_list,
  time_col,
  unit_col,
  measure_col,
  value_col,
  fitted_vars
)
Arguments
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


Method clone()

The objects of this class are cloneable with this method.

Usage
ElasticSynth$clone(deep = FALSE)
Arguments
deep

Whether to make a deep clone.


tdn158/ElasticSynth documentation built on Feb. 26, 2021, 2:07 p.m.