ir_calc: Calculate confidence interval for crude incidence rate

View source: R/ir_calc.R

ir_calcR Documentation

Calculate confidence interval for crude incidence rate

Description

7 different methods that I found online for calculating the confidence interval for a crude incidence rate. Note that these are all two sided. Most of these come from https://www.openepi.com and their documentation and formulas.

Mid-P exact test seems to be the preferred method

  • "Mid-P exact test" using Miettinen's (1974d) modification, as described in Epidemiologic Analysis with a Programmable Calculator, 1979.

  • "Fisher's exact test" based on the formula (Armitage,1971; Snedecor & Cochran,1965) as described in Epidemiologic Analysis with a Programmable Calculator, 1979.

  • "Exact Poisson is the same as the Fisher's exact but calculated differently.

  • "Normal approximation" to the Poisson distribution as described by Rosner, Fundamentals of Biostatistics (5th Ed).

  • "Byar approx. Poisson" as described in Rothman and Boice, Epidemiologic Analysis with a Programmable Calculator, 1979.

  • "Rothman/Greenland" as described in Rothman and Greenland, Modern Epidemiology (2nd Ed).

  • "CCRB" comes from the follwing website and they do not offer documentation for their methods: http://www2.ccrb.cuhk.edu.hk/stat/confidence%20interval/CI%20for%20single%20rate.htm

Usage

ir_calc(a, N, pt_units = 100, alpha = 0.05, interval = c(0, 1e+07))

Arguments

a

Number of clinical events

N

Person-time at risk

pt_units

Factor to multiply rate by to get Person-time; default is 100.

alpha

Significance level for two-sided confidence interval

interval

a vector containing the end-points of the interval to be searched for the root. The function base::uniroot() is used to solve for some confidence intervals iteratively.

Value

A tbl_df

References

http://epid.blogspot.com/2012/08/how-to-calculate-confidence-interval-of.html https://www.openepi.com/PDFDocs/PersonTime1Doc.pdf https://seer.cancer.gov/seerstat/WebHelp/Rate_Algorithms.htm

Examples

# options(pillar.sigfig = 3)
ir_calc(a = 18,
        N = 352 + 10.5,
        alpha = 0.05)

#### From  https://www.openepi.com --------------------------------

# Person-Time Rate and 95% Confidence Intervals
# Per 100 Person-Time Units
# Number of cases:	18
# Person-Time:	362.5
#
#                      Lower CL	  Rate	Upper CL
# Mid-P exact test	       3.035	 4.966	   7.696
# Fisher's exact test	   2.943		         7.848
# Normal approximation	   2.672		         7.259
# Byar approx. Poisson	   2.941		         7.848
# Rothman/Greenland	     3.129		         7.881

emilelatour/lamisc documentation built on April 9, 2024, 10:33 a.m.