R/echoice2.R
vd_dem_summarise.Rd
Adds summaries of posterior draws of demand to tibble. (using the new demand draw format)
demand draws
Quantiles for Credibility Intervals (default: 90% interval)
Summary of demand predictions
# \donttest{
data(icecream)
#run MCMC sampler (use way more than 10 draws for actual use)
icecream_est <- icecream %>% dplyr::filter(id<10) %>% vd_est_vdm(R=10, keep=1)
#> Using 16 cores
#> MCMC in progress
#> MCMC complete
#> Total Time Elapsed: 0.00 minutes
#Generate demand predictions
icecream_predicted_demand=
icecream %>% dplyr::filter(id<10) %>%
vd_dem_vdm(icecream_est)
#> Using 16 cores
#aggregate
brand_lvl_pred_demand <-
icecream_predicted_demand %>% ec_dem_aggregate("Brand")
#summarise
brand_lvl_pred_demand %>% vd_dem_summarise()
#> # A tibble: 7 × 8
#> Brand .demdraws `E(demand)` `S(demand)` `CI-5%` `CI-95%` E(inte…¹ S(int…²
#> <fct> <list> <dbl> <dbl> <dbl> <dbl> <dbl> <dbl>
#> 1 BenNJerry <dbl [10]> 137. 33.6 112. 193. 1 0
#> 2 BlueBell <dbl [10]> 144. 30.3 110. 194. 1 0
#> 3 BlueBunny <dbl [10]> 118. 26.3 90.0 162. 1 0
#> 4 Breyers <dbl [10]> 127. 39.8 71.7 189. 1 0
#> 5 Dryers <dbl [10]> 116. 42.2 62.7 185. 1 0
#> 6 HaagenDa <dbl [10]> 117. 27.1 82.8 156. 1 0
#> 7 Store <dbl [10]> 147. 63.3 86.9 247. 1 0
#> # … with abbreviated variable names ¹`E(interior)`, ²`S(interior)`
# }