zepid.calc.utils.incidence_rate_ratio

zepid.calc.utils.incidence_rate_ratio(a, c, t1, t2, alpha=0.05)

Calculates the incidence rate ratio and confidence intervals from count data

Incidence rate ratio is calculated from

\[IR = \frac{a}{t_1} / \frac{c}{t_2}\]

Incidence rate ratio standard error is

\[SE = \left(\frac{1}{a} + \frac{1}{c}\right)^{\frac{1}{2}}\]
Parameters:
  • a (integer, float) – Count of exposed individuals with outcome
  • c (integer, float) – Count of unexposed individuals with outcome
  • t1 (integer, float) – Person-time contributed by those who were exposed
  • t2 (integer, float) – Person-time contributed by those who were unexposed
  • alpha (float, optional) – Alpha value to calculate two-sided Wald confidence intervals. Default is 95% confidence interval
Returns:

Tuple of IR, lower CL, upper CL, SE

Return type:

tuple

Examples

Estimate the incidence rate ratio, standard error, and confidence intervals

>>> from zepid.calc import incidence_rate_ratio
>>> ir = incidence_rate_ratio(45, 21, 109, 158)

Extracting the estimated incidence rate ratio

>>> ir.point_estimate

Extracting the lower and upper confidence intervals, respectively

>>> ir.lower_bound
>>> ir.upper_bound

Extracting the standard error

>>> ir.standard_error