Description Usage Arguments Details Value References See Also Examples
Calculate a log normal distribution confidence interval.
1 | get_ci_lnorm(interval, estimate, variance_log)
|
interval |
A scalar between 0 and 1, indicating the width of the
interval. For example, use |
estimate |
A numeric vector containing the point estimates. |
variance_log |
A numeric vector containing the variances of the
log-transformed |
This function doesn't need to know which type of epidemiological
measure has been passed as estimate
(e.g., rate, risk). It also assumes
that the values of the input arguments estimate
and variance_log
are aligned
and that the vectors are the same length.
This function is used to construct confidence intervals in get_spec_rt()
and
get_ds_rt()
.
A data frame with columns lower
and upper
, which contain the lower
and upper limits of a confidence interval, respectively.
get_ci_norm()
, get_ci_pois()
, get_ci_gamma()
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 | ## Not run:
# calculate a single confidence interval
get_ci_lnorm(interval = 0.95, estimate = 0.2, variance_log = 0.05)
# calculate confidence intervals around multiple estimates
get_ci_lnorm(interval = 0.95, estimate = c(0.2, 0.4), variance_log = c(0.05, 0.025))
# use columns of a data frame as inputs
df <- data.frame(estimate = c(0.2, 0.4), variance_log = c(0.05, 0.025))
# using dplyr
df %>%
dplyr::mutate(get_ci_lnorm(0.975, estimate, variance_log))
# using base
get_ci_lnorm(interval = 0.975, estimate = df$estimate, variance_log = df$variance_log)
## End(Not run)
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.