Description Usage Arguments Details Value References See Also Examples
Calculate a normal distribution confidence interval.
1 | get_ci_norm(interval, estimate, variance)
|
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 |
A numeric vector containing the variances. |
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
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()
. In general, the normal distribution should not be used to construct
confidence intervals when the standard deviation is greater than a third of
the mean. The function throws a warning if this is the case.
A data frame with columns lower
and upper
, which contain the lower
and upper limits of a confidence interval, respectively.
get_ci_lnorm()
, 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_norm(interval = 0.95, estimate = 10, variance = 4)
# calculate confidence intervals around multiple estimates
get_ci_norm(interval = 0.95, estimate = c(10, 20), variance = c(4, 9))
# use columns of a data frame as inputs
df <- data.frame(estimate = c(10, 20, 30), variance = c(4, 9, 16))
# using dplyr
df %>%
dplyr::mutate(get_ci_norm(0.975, estimate, variance))
# using base
get_ci_norm(interval = 0.975, estimate = df$estimate, variance = df$variance)
## End(Not run)
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.