View source: R/pre_test_power.R
GeoLiftPower.search | R Documentation |
Development on GeoLiftPower.search()
is complete.
We recommend switching to GeoLiftMarketSelection()
for new code, which is easier to use, more featureful,
and still under active development.
GeoLiftPower.search
provides power calculations for unknown
test markets, number of test locations, and test duration.
GeoLiftPower.search(
data,
treatment_periods,
N = 1,
lookback_window = 1,
X = c(),
Y_id = "Y",
location_id = "location",
time_id = "time",
top_results = 5,
alpha = 0.1,
type = "pValue",
normalize = FALSE,
model = "none",
fixed_effects = TRUE,
stat_func = NULL,
dtw = 0,
ProgressBar = FALSE,
run_stochastic_process = FALSE,
parallel = TRUE,
parallel_setup = "sequential",
import_augsynth_from = "library(augsynth)",
import_tidyr_from = "library(tidyr)"
)
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_periods |
List of treatment periods to calculate power for. |
N |
List of number of test markets to calculate power for. |
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. |
X |
List of names of covariates. |
Y_id |
Name of the outcome variable (String). |
location_id |
Name of the location variable (String). |
time_id |
Name of the time variable (String). |
top_results |
Number of results to display. |
alpha |
Significance Level. By default 0.1. |
type |
Method of inference used in the analysis. pValue=Provides conformal inference to provide the aggregate p-value for the null hypothesis of no effect from the intervention. The Default type is pValue. Imbalance=Uses the model's Scaled L2 Imbalance metric. |
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. |
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.
|
fixed_effects |
A logic flag indicating whether to include unit fixed effects in the model. Set to TRUE by default. |
stat_func |
Function to compute test statistic. NULL by default. |
dtw |
Emphasis on Dynamic Time Warping (DTW), dtw = 1 focuses exclusively on this metric while dtw = 0 (default) relies on correlations only. |
ProgressBar |
A logic flag indicating whether to display a progress bar to track progress. Set to FALSE by default. |
run_stochastic_process |
A logic flag indicating whether to select test markets through random sampling of the the similarity matrix. Given that interpolation biases may be relevant if the synthetic control matches the characteristics of the test unit by averaging away large discrepancies between the characteristics of the test and the units in the synthetic controls, it is recommended to only use random sampling after making sure all units are similar. This parameter is set by default to FALSE. |
parallel |
A logic flag indicating whether to use parallel computing to speed up calculations. Set to TRUE by default. |
parallel_setup |
A string indicating parallel workers set-up. Set to "sequential" by default. |
import_augsynth_from |
Points to where the augsynth package should be imported from to send to the nodes. |
import_tidyr_from |
Points to where the tidyr package should be imported from to send to the nodes. |
Data frame with the ordered list of best locations and their average power.
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.