Usage
ASCMExecution(
data,
treatment_locations,
treatment_start_time,
treatment_end_time,
Y_id = "Y",
time_id = "time",
location_id = "location",
X = c(),
model = "none",
fixed_effects = TRUE
)Arguments
- data
A data.frame containing the historical conversions by geographic unit. It requires a "locations" column with the geo name, a "Y" column with the outcome data (units), a time column with the indicator of the time period (starting at 1), and covariates.
- treatment_locations
Vector of treatment locations.
- treatment_start_time
Time index of the start of the treatment.
- treatment_end_time
Time index of the end of the treatment.
- 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.
- 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.
- fixed_effects
A logic flag indicating whether to include unit fixed effects in the model. Set to TRUE by default.
Value
List object that contains:
- "augsynth_model":
Generalized Augmented Sunthetic Controls results.
- "data":
Properly formatted data to fit GeoLift.
- "treatment_locations":
Treatment locations being used in lower case.
Examples
geo_test <- GeoDataRead(GeoLift_Test, date_id = "date", location_id = "location",
Y_id = "Y", format = "yyyy-mm-dd")
fit <- ASCMExecution(data = geo_test, treatment_locations = c("chicago", "portland"),
treatment_start_time = 91, treatment_end_time = 105)
fit$augsynth_model$scaled_l2_imbalance
#> [1] 0.1636394