Calculate the total and test market's aggregated KPI by time and location.
Source:R/auxiliary.R
AppendAgg.RdArguments
- 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.
- locs
list of test locations. If none are provided, only the aggregated KPI (total) will be calculated and appended. Set to NULL by default.
Value
A data frame with additional values for the test regions (combined_test) and total KPI (total).
Examples
geo_pre <- GeoDataRead(GeoLift_PreTest, date_id = "date", location_id = "location",
Y_id = "Y", format = "yyyy-mm-dd")
head(AppendAgg(geo_pre, locs = c("chicago", "portland")))
#> location time Y
#> 1 control_markets 1 143394
#> 2 control_markets 2 162216
#> 3 control_markets 3 217581
#> 4 control_markets 4 171161
#> 5 control_markets 5 129723
#> 6 control_markets 6 135881