View source: R/pre_test_power.R
MarketSelection | R Documentation |
MarketSelection
helps calculate the best markets based
on Dynamic Time Warping between the locations' time-series.
MarketSelection(
data,
location_id = "location",
time_id = "time",
Y_id = "Y",
dtw = 0,
exclude_markets = c()
)
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. |
Matrix of the best markets. The second to last columns show the best to worst market matches for the location in the first column.
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.