Skip to contents

Incidence rate ratios for a CPB fit

Usage

irr(object, ...)

# S3 method for class 'cpb'
irr(object, level = 0.95, ...)

Arguments

object

A "cpb" object. With se = "bootstrap" at fit time the ratios carry bootstrap percentile intervals; otherwise point estimates are returned with method = "none", as for every other irr() method.

...

Further arguments passed to methods.

level

Confidence level (default 0.95).

Value

A "ud_irr" data frame – the package-wide rate-ratio contract (columns term, equation, ratio, estimate, lower, upper, method) shared by every irr() method; here with bootstrap percentile intervals from the stored draws.

Examples

# \donttest{
set.seed(8); x <- rnorm(200)
N <- pmax(round(exp(1.5 + 0.4 * x) / 0.5), 1); y <- rbinom(200, N, 0.5)
fit <- cpb(y ~ x, data.frame(y = y, x = x)[y > 0, ], se = "bootstrap", B = 40)
irr(fit)
#>         term equation ratio estimate lower upper             method
#>  (Intercept)    count   IRR    4.473 4.320 4.661 bootstrap (stored)
#>            x    count   IRR    1.502 1.434 1.549 bootstrap (stored)
# }