mod <- mod_pois(injuries ~ age:sex + ethnicity + year,
data = nzl_injuries,
exposure = 1) |>
fit()
rep_data <- mod |>
replicate_data()
library(dplyr)
rep_data |>
group_by(.replicate) |>
count(wt = injuries)
## when the overall model includes an rr3 data model,
## replicate data are rounded to base 3
mod_pois(injuries ~ age:sex + ethnicity + year,
data = nzl_injuries,
exposure = popn) |>
set_datamod_outcome_rr3() |>
fit() |>
replicate_data()
Run the code above in your browser using DataLab