View source: R/pre_test_power.R
run_simulations | R Documentation |
run_simulations
computes simulations for each treatment market.
run_simulations(
data,
treatment_combinations,
treatment_durations,
effect_sizes = 0,
side_of_test = "two_sided",
conformal_type = conformal_type,
ns = ns,
lookback_window = 1,
parallel = TRUE,
ProgressBar = FALSE,
cpic = 0,
X = c(),
normalize = FALSE,
fixed_effects = TRUE,
model = "none"
)
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_combinations |
A matrix of treatment locations. Each row symbolizes a combination, each column one element of the combination. |
treatment_durations |
Expected durations of the experiment. |
effect_sizes |
A vector of effect sizes to simulate. |
side_of_test |
A string indicating whether confidence will be determined using a one sided or a two sided test.
|
conformal_type |
Type of conformal inference used. Can be either "iid" for Independent and identically distributed or "block" for moving block permutations. Set to "iid" by default. |
ns |
Number of resamples for "iid" permutations if |
lookback_window |
A number indicating how far back in time the simulations for the power analysis should go. For instance, a value equal to 5 will simulate power for the last five possible tests. By default lookback_window = 1 which will only execute the most recent test based on the data. |
parallel |
A logic flag indicating whether to use parallel computing to speed up calculations. Set to TRUE by default. |
ProgressBar |
A logic flag indicating whether to display a progress bar to track progress. Set to FALSE by default. |
cpic |
Number indicating the Cost Per Incremental Conversion. |
X |
List of names of covariates. |
normalize |
A logic flag indicating whether to scale the outcome which is useful to accelerate computing speed when the magnitude of the data is large. The default is FALSE. |
fixed_effects |
A logic flag indicating whether to include unit fixed effects in the model. Set to TRUE by default. |
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.
|
DataFrame that contains:
"location": Test locations.
"pvalue": P Value.
"tp": Time period index.
"es": Effect Size used for the simulation.
"treatment_start_time": Treatment start time for the simulation
"investment": Estimated Investment
"ScaledL2Imbalance": Scaled L2 Imbalance metric
"att_estimator": Detected Average Treatment on the Treated
"detected_lift": Detected % Lift by GeoLift for an effect size
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.