Calculates a 95 percent confidence interval for a rate using the Rothman/Greenland method described in http://www.openepi.com/PDFDocs/PersonTime1Doc.pdf.

rate_confint(numerator, denominator)

Arguments

numerator

Count of events

denominator

Count of person-years

Value

A data frame with three columns giving the rate, lower confidence interval and upper confidence interval.

Examples

dat <- data.frame(n = 1, denom = 10)
rate_confint(dat$n, dat$denom)
#>   rate        lci       uci
#> 1  0.1 0.01408584 0.7099327
dat <- data.frame(n = 5, denom = 25) # replicates output from openepi just fine.
rate_confint(dat$n, dat$denom)
#>   rate        lci       uci
#> 1  0.2 0.08324422 0.4805138