rep_median_ci {kdry} | R Documentation |
rep_median_ci
Description
Reporting helper function: computes and formats median and confidence interval from a numeric vector.
Usage
rep_median_ci(
x,
conf_int,
digits = 2,
na.rm = TRUE,
collapse = "to",
iqr_brackets = c("round", "square"),
iqr_prefix = TRUE,
weighted = FALSE,
weights = NA
)
Arguments
x |
A numeric vector. |
conf_int |
A numeric between 0 and 100 to indicate the confidence interval that should be computed. |
digits |
An integer indicating the number of decimal places. |
na.rm |
A logical indicating if missings should be removed from |
collapse |
A character which is placed between the lower and the upper confidence bound in the formatted output. |
iqr_brackets |
A character. Either |
iqr_prefix |
A logical. If |
weighted |
A logical. If |
weights |
A numeric vector of weights passed further on to
|
Value
A character with the formatted output.
See Also
stats::median, stats::quantile, Hmisc::wtd.quantile()
Examples
set.seed(123)
x <- rnorm(1000)
rep_median_ci(x, conf_int = 95)
rep_median_ci(rep(1, 10), conf_int = 95)
rep_median_ci(x, conf_int = 95, collapse = "-")
rep_median_ci(x, iqr_brackets = "square", conf_int = 50)