confIntRate {biostatUZH}R Documentation

Compute confidence interval for a Poisson rate via different methods

Description

Compute a confidence interval for a Poisson rate using several methods. The individual methods are also available as separate functions waldRate and wilsonRate.

Usage

confIntRate(x, t, conf.level = 0.95)

Arguments

x

Number of events.

t

Total observation time.

conf.level

Confidence level for confidence interval.

Value

A list with the entries:

p

Estimated rate.

CIs

Dataframe containing the estimated confidence intervals.

Author(s)

Leonhard Held

References

Held, L., Rufibach, K. and Seifert, B. (2013). Medizinische Statistik - Konzepte, Methoden, Anwendungen. Section 8.2.

See Also

Functions for some of the intervals provided here are available in Hmisc (see the examples).

Examples

## Calculate confidence bounds for a Poisson rate by different methods. 
x <- 1
t <- 3
ci <- confIntRate(x, t)$CIs
ci
p <- confIntRate(x, t)$rate

plot(0, 0, type = 'n', ylim = c(0, 3), xlim = c(0, 3), xlab = 'p', 
    ylab = '', yaxt = 'n')
lines(ci[1, 2:3], c(1, 1))
lines(ci[2, 2:3], c(2, 2))
points(p, 1, pch=19)
points(p, 2, pch=19)
text(0.5, 0.85, 'wald')
text(0.5, 1.85, 'wilson')

[Package biostatUZH version 1.8.0 Index]