confIntRate {biostatUZH} | R Documentation |
Compute a confidence interval for a Poisson rate using several
methods. The individual methods are also
available as separate functions waldRate
and wilsonRate
.
confIntRate(x, t, conf.level = 0.95)
x |
Number of events. |
t |
Total observation time. |
conf.level |
Confidence level for confidence interval. |
A list with the entries:
p |
Estimated rate. |
CIs |
Dataframe containing the estimated confidence intervals. |
Leonhard Held
Held, L., Rufibach, K. and Seifert, B. (2013). Medizinische Statistik - Konzepte, Methoden, Anwendungen. Section 8.2.
Functions for some of the intervals provided here are available in Hmisc (see the 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')