## specify a model with exposure
mod <- mod_pois(injuries ~ age:sex + ethnicity + year,
data = nzl_injuries,
exposure = popn)
## specify a model without exposure
mod <- mod_pois(injuries ~ age:sex + ethnicity + year,
data = nzl_injuries,
exposure = 1)
## use a formula to specify exposure
mod <- mod_pois(injuries ~ age:sex + ethnicity + year,
data = nzl_injuries,
exposure = ~ pmax(popn, 1))
Run the code above in your browser using DataLab