Skip to contents

[Experimental]

SplitTreatmentEstimation fits a control group to each location within a Treatment group and calculates their imbalance metrics.

Usage

SplitTreatmentEstimation(
  treatment_locations,
  data,
  treatment_start_time,
  treatment_end_time,
  model,
  verbose = FALSE,
  Y_id = "Y",
  time_id = "time",
  location_id = "location",
  X = c(),
  fixed_effects = TRUE
)

Arguments

treatment_locations

Vector of locations where the treatment was applied.

data

DataFrame that GeoLfit will use to determine a result. Should be the output of GeoDataRead.

treatment_start_time

Time index of the start of the treatment.

treatment_end_time

Time index of the end of the treatment.

model

A string indicating the outcome model used to augment the Augmented Synthetic Control Method. Augmentation through a prognostic function can improve fit and reduce L2 imbalance metrics.

"None":

ASCM is not augmented by a prognostic function. Defualt.

"Ridge":

Augments with a Ridge regression. Recommended to improve fit for smaller panels (less than 40 locations and 100 time-stamps.))

"GSYN":

Augments with a Generalized Synthetic Control Method. Recommended to improve fit for larger panels (more than 40 locations and 100 time-stamps.

verbose

boolean that determines if processing messages will be shown.

Y_id

Name of the outcome variable (String).

time_id

Name of the time variable (String).

location_id

Name of the location variable (String).

X

Vector with covariates names.

fixed_effects

A logic flag indicating whether to include unit fixed effects in the model. Set to TRUE by default.

Value

Dataframe with L2 imbalance ranking and these columns:

"treatment_location":

Single Treatment location being considered.

"l2_imbalance":

L2 imbalance for treatment_location estimation.

"scaled_l2_imbalance":

Scaled L2 imbalance for treatment_location estimation.

"treatment_group_size":

Size of treatment group for each iteration.

"model":

Outcome model being used for Augmented Synthetic Control.

Examples

geo_test <- GeoDataRead(GeoLift_Test, date_id = "date", location_id = "location",
  Y_id = "Y", format = "yyyy-mm-dd")
SplitTreatmentEstimation(treatment_locations = c("chicago", "portland"),
  data = geo_test, treatment_start_time = 91, treatment_end_time = 105,
  model = "none")
#>   treatment_location l2_imbalance l2_imbalance_to_y_hat scaled_l2_imbalance
#> 1            chicago     1138.713           0.004335891           0.2420779
#> 2           portland     1406.099           0.005262163           0.2131132
#>   treatment_group_size model
#> 1                    2  none
#> 2                    2  none