To save me having to use separate summary functions, I need to include calculation of summary information in extract_mc_results.
I also need to be careful and more clever with the calculation of the summaries, in particular getting the distances calculated appropriately.
These are really slow at the moment as I do an epic joining approach, whereas I could probably write some nicer code in c++ to handle the summary statistics.
A few extra notes
# Some sort of summary table that returns the following columns
# n_added (n_added)
# This is taken from mc_model$n_added
# **n_added_location (for each urban/rural)**
# This is taken from group_by(mc_model,first(n_added))
# **location (is it urban/rural/overall)**
# This is taken from group_by(mc_model) + ungroup()
# **n_ohca (number OHCA events that occured)**
# This is taken from nrow(mc_model$user)
# n_ohca_cov (number of OHCA events that are covered)
# nrow(mc_model$users_affected) + sum(dat_dist$is_covered)
# total_aeds (total number of AEDs (original AEDs + n_added))
# nrow(mc_model$facility) + nrow(mc_model$facilities_added)
# pct_ohca_cov
# (nrow(mc_model$users_affected) + sum(dat_dist$is_covered))
# /
# nrow(mc_model$users)
# mean_dist_to_aed
# round(mean(dat_dist$distance),2)
# sd_dist_to_aed
# round(sd(dat_dist$distance),2)
To save me having to use separate summary functions, I need to include calculation of summary information in
extract_mc_results
.I also need to be careful and more clever with the calculation of the summaries, in particular getting the distances calculated appropriately.
These are really slow at the moment as I do an epic joining approach, whereas I could probably write some nicer code in c++ to handle the summary statistics.
A few extra notes