View source: R/pre_test_power.R
GeoLiftPower | R Documentation |
This function runs power calculations for input historical geo data for a pre-determined set of test locations.
GeoLiftPower(
data,
locations,
effect_size = seq(0, 1, 0.05),
treatment_periods,
lookback_window = 1,
cpic = 0,
X = c(),
Y_id = "Y",
location_id = "location",
time_id = "time",
alpha = 0.1,
type = "pValue",
normalize = FALSE,
model = "none",
fixed_effects = TRUE,
ProgressBar = FALSE,
parallel = TRUE,
parallel_setup = "sequential",
side_of_test = "two_sided",
conformal_type = "iid",
ns = 1000,
import_augsynth_from = "library(augsynth)",
import_tidyr_from = "library(tidyr)"
)
## S3 method for class 'GeoLiftPower'
plot(
x,
actual_values = TRUE,
smoothed_values = TRUE,
show_mde = FALSE,
breaks_x_axis = 10,
notes = "",
...
)
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. |
locations |
A semi-colon separated list of test geo locations. |
effect_size |
A vector of effect sizes to test by default a sequence between 0 - 100 percent in 5 percent increments: seq(0,1,0.05). |
treatment_periods |
Expected length of the test. A vector of possible lengths can be entered for multiple options. |
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. |
cpic |
Cost Per Incremental Conversion for estimated test minimum budget. The default value is 0, in which case no investment estimation will be provided. |
X |
List of names of covariates. No covariates are used by default. |
Y_id |
Name of the outcome variable. "Y" by default. |
location_id |
Name of the location variable. "Y" by default. |
time_id |
Name of the time variable. "Y" by default. |
alpha |
Significance level. Set to 0.1 by default. |
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. |
ProgressBar |
A logic flag indicating whether to display a progress bar to track progress. Set to FALSE by default. |
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. |
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 |
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. |
x |
|
actual_values |
Logic flag indicating whether to include in the plot the actual values. TRUE by default. |
smoothed_values |
Logic flag indicating whether to include in the plot the smoothed values. TRUE by default. |
show_mde |
Logic flag indicating whether to include in the plot the positive and negative MDEs. FALSE by default. |
breaks_x_axis |
Numeric value indicating the number of breaks in the
x-axis of the power plot. You may get slightly more or fewer breaks that
requested based on |
notes |
String with additional notes to add as caption. |
... |
additional arguments |
GeoLiftPower object that contains:
"location": Test units of the simulation
"pvalue": P Value for each simulation
"duration": Duration of the simulation
"effect_size": Effect Size used for the simulation
"treatment_start": Treatment start time for the simulation
"investment": Estimated Investment
"cpipc": Cost Per Incremental Conversion
"ScaledL2Imbalance": Scaled L2 Imbalance metric
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.