GeoLiftPowerFinder: Power calculations for unknown test market locations, number...

View source: R/pre_test_power.R

GeoLiftPowerFinderR Documentation

Power calculations for unknown test market locations, number of test markets, and test duration.

Description

[Superseded]

Development on GeoLiftPowerFinder() is complete. We recommend switching to GeoLiftMarketSelection() for new code, which is easier to use, more featureful, and still under active development.

GeoLiftPowerFinder provides power calculations for unknown test markets, number of test locations, and test duration.

Usage

GeoLiftPowerFinder(
  data,
  treatment_periods,
  N = 1,
  X = c(),
  Y_id = "Y",
  location_id = "location",
  time_id = "time",
  effect_size = seq(0, 0.25, 0.05),
  top_results = 5,
  alpha = 0.1,
  normalize = FALSE,
  model = "none",
  fixed_effects = TRUE,
  dtw = 0,
  ProgressBar = FALSE,
  plot_best = FALSE,
  run_stochastic_process = FALSE,
  parallel = TRUE,
  parallel_setup = "sequential",
  side_of_test = "two_sided",
  import_augsynth_from = "library(augsynth)",
  import_tidyr_from = "library(tidyr)"
)

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_periods

List of treatment periods to calculate power for.

N

List of number of test markets to calculate power for.

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).

effect_size

A vector of effect sizes to test by default a sequence between 0 - 25 percent in 5 percent increments: seq(0,0.25,0.05). Make sure that the sequence includes zero.

top_results

Number of results to display.

alpha

Significance Level. By default 0.1.

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.

  • "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.

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.

plot_best

A logic flag indicating whether to plot the best 4 tests for each treatment length. 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.

side_of_test

A string indicating whether confidence will be determined using a one sided or a two sided test.

  • "two_sided": The test statistic is the sum of all treatment effects, i.e. sum(abs(x)). Defualt.

  • "one_sided": One-sided test against positive or negaative effects i.e. If the effect being applied is negative, then defaults to -sum(x). H0: ES >= 0; HA: ES < 0. If the effect being applied is positive, then defaults to sum(x). H0: ES <= 0; HA: ES > 0.

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.

Value

Data frame with the ordered list of best locations and their average power.


facebookincubator/GeoLift documentation built on May 31, 2024, 10:09 a.m.