MarketSelection: Market selection tool.

View source: R/pre_test_power.R

MarketSelectionR Documentation

Market selection tool.

Description

[Stable]

MarketSelection helps calculate the best markets based on Dynamic Time Warping between the locations' time-series.

Usage

MarketSelection(
  data,
  location_id = "location",
  time_id = "time",
  Y_id = "Y",
  dtw = 0,
  exclude_markets = c()
)

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.

location_id

Name of the location variable (String).

time_id

Name of the time variable (String).

Y_id

Name of the outcome variable (String).

dtw

Emphasis on Dynamic Time Warping (DTW), dtw = 1 focuses exclusively on this metric while dtw = 0 (default) relies on correlations only.

exclude_markets

A list of markets or locations that won't be considered for the test market selection, but will remain in the pool of controls. Empty list by default.

Value

Matrix of the best markets. The second to last columns show the best to worst market matches for the location in the first column.


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