View source: R/utils-helpers.R
| ci_poisson | R Documentation |
Computes an exact Poisson confidence interval for a count rate.
ci_poisson(x, n, conf_level = 0.95)
x |
Vector (or sum) of observed counts, e.g. all counts falling in one exposure bin |
n |
Number of units the counts were accumulated over (e.g. the
number of observations in the bin); the rate being estimated is
|
conf_level |
Confidence level |
The count-response analogue of ci_clopper_pearson(), used by
the quantile-binned summary layer (see er_plot_add_quantiles())
and er_vpc_add_observed()/er_vpc_add_simulated() when
response_type = "count" is explicitly declared. Unlike ci_t()
(the default, opt-in-required
approximation used when a count response auto-detects or is declared
"continuous"), this interval is exact and never produces a
negative lower bound. Uses the standard exact ("Garwood") Poisson
interval, derived from the chi-squared/gamma relationship; if the
total count is 0, the lower bound is 0.
Named numeric vector (lower, upper) for the rate sum(x) / n, with confidence level stored as an attribute.
ci_poisson(3, 10)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.