## rename 'age' variable to something unusual
injuries2 <- nzl_injuries
injuries2$age_last_birthday <- injuries2$age
## mod_pois does not recognize age variable
mod <- mod_pois(injuries ~ age_last_birthday * ethnicity + year,
data = injuries2,
exposure = popn)
mod
## so we set the age variable explicitly
## (which, as a side effect, changes the prior on
## the age main effect)
mod |>
set_var_age(name = "age_last_birthday")
Run the code above in your browser using DataLab