Description Usage Arguments Details Value References See Also Examples
Calculate a Poisson distribution confidence interval. This
function imitates stats::qpois()
using stats::qchisq()
to allow for the
continuous extension of the estimate.
1 | get_ci_pois(interval, x, y = NULL)
|
interval |
A scalar between 0 and 1, indicating the width of the
interval. For example, use |
x |
A numeric vector of positive integers. It can contain the stratum-specific number of events or the observed number of events in the study population. |
y |
A vector of positive numbers. It can contain the population-time for
each stratum or the expected number of events. The default value is |
When working with rates, pass the stratum-specific
number of events as x
and the population-time for each stratum as y
.
When working with standardized morbidity/mortality ratios, pass the observed
number of events as x
and the expected number of events as y
. Ensure
that the values of x
and y
are aligned and that the vectors are the same
length.
To calculate a confidence interval around count data, pass a vector
of counts as x
.
This function is used to construct confidence intervals in get_spec_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_lnorm()
, get_ci_gamma()
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 | ## Not run:
# calculate a single confidence interval
get_ci_pois(interval = 0.95, x = 49, y = 52) # rate
get_ci_pois(interval = 0.95, x = 11) # count
# use columns of a data frame as inputs
df <- data.frame(x = c(24, 49), y = c(94, 52))
# using dplyr
df %>%
dplyr::mutate(get_ci_pois(0.95, x, y))
# using base
get_ci_pois(0.95, df$x, df$y)
## End(Not run)
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.