View source: R/epiparameter-utils.R
create_summary_stats | R Documentation |
A helper function when creating an <epiparameter>
object to
create a summary statistics list with sensible defaults, type checking
and arguments to help remember which summary statistics can be accepted in
the list.
create_summary_stats(
mean = NA_real_,
mean_ci_limits = c(NA_real_, NA_real_),
mean_ci = NA_real_,
sd = NA_real_,
sd_ci_limits = c(NA_real_, NA_real_),
sd_ci = NA_real_,
median = NA_real_,
median_ci_limits = c(NA_real_, NA_real_),
median_ci = NA_real_,
dispersion = NA_real_,
dispersion_ci_limits = c(NA_real_, NA_real_),
dispersion_ci = NA_real_,
lower_range = NA_real_,
upper_range = NA_real_,
quantiles = NA_real_
)
mean |
A |
mean_ci_limits |
A |
mean_ci |
A |
sd |
A |
sd_ci_limits |
A |
sd_ci |
A |
median |
A |
median_ci_limits |
A |
median_ci |
A |
dispersion |
A |
dispersion_ci_limits |
A |
dispersion_ci |
A |
lower_range |
The lower range of the data, used to infer the parameters of the distribution when not provided. |
upper_range |
The upper range of the data, used to infer the parameters of the distribution when not provided. |
quantiles |
A |
A list of summary statistics. The output list has element names equal to the function arguments:
$mean $mean_ci_limits $mean_ci $sd $sd_ci_limits $sd_ci $median $median_ci_limits $median_ci $dispersion $dispersion_ci_limits $dispersion_ci $lower_range $upper_range $quantiles
# mean and standard deviation
create_summary_stats(mean = 5, sd = 2)
# mean and standard deviation with uncertainty
create_summary_stats(
mean = 4,
mean_ci_limits = c(2.1, 5.7),
mean_ci = 95,
sd = 0.7,
sd_ci_limits = c(0.3, 1.1),
sd_ci = 95
)
# median and range
create_summary_stats(
median = 5,
lower_range = 1,
upper_range = 13
)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.