pvalueCalc: Calculate p-value for GeoLift.

View source: R/pre_test_power.R

pvalueCalcR Documentation

Calculate p-value for GeoLift.

Description

[Stable]

pvalueCalc calculates the p-value for a GeoLift object.

Usage

pvalueCalc(
  data,
  sim,
  max_time,
  tp,
  es,
  locations,
  cpic,
  X,
  type = "pValue",
  normalize = FALSE,
  fixed_effects = FALSE,
  stat_func = stat_func,
  model = "none",
  conformal_type = conformal_type,
  ns = ns
)

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.

sim

Time simulation index.

max_time

Treatment end index.

tp

Time period index.

es

Effect Size.

locations

List of test locations.

cpic

Cost Per Incremental Conversion.

X

List of names of covariates.

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.

fixed_effects

A logic flag indicating whether to include unit fixed effects in the model. Set to FALSE by default.

stat_func

Function to compute test statistic. NULL by default.

model

A string indicating the outcome model used in the Augmented Synthetic Control Method. Set to Generalized Synthetic Controls "none" by default.

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 ⁠conformal_type = "iid⁠. Set to 1000 by default.

Value

List 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


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