stochastic_market_selector selects the markets to be tested
by randomly sampling from the similarity_matrix.
It gets groups of 2 elements and samples one of them. It repeats
this process until the treatment_size is equal to the sample.
Usage
stochastic_market_selector(
treatment_size,
similarity_matrix,
run_stochastic_process = FALSE
)Arguments
- treatment_size
Is the amount of location units within the treatment group.
- similarity_matrix
Matrix that sorts each location in terms of descending correlation.
- 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.
Value
Returns a matrix of sampled combinations of treatments. Each row represents a different treatment.
Examples
geo_pre <- GeoDataRead(GeoLift_PreTest, date_id = "date", location_id = "location",
Y_id = "Y", format = "yyyy-mm-dd")
head(stochastic_market_selector(2, MarketSelection(geo_pre)))
#>
#> Deterministic setup with 2 locations in treatment.
#> [,1] [,2]
#> [1,] "atlanta" "chicago"
#> [2,] "austin" "oakland"
#> [3,] "baltimore" "philadelphia"
#> [4,] "baton rouge" "portland"
#> [5,] "boston" "new orleans"
#> [6,] "chicago" "cincinnati"