## specify 'rate'
rate <- data.frame(sex = c("Female", "Male"),
mean = c(0.1, 0.13),
disp = c(0.2, 0.2))
## specify model
mod <- mod_pois(divorces ~ age * sex + time,
data = nzl_divorces,
exposure = population) |>
set_datamod_overcount(rate)
mod
## fit model
mod <- mod |>
fit()
mod
## original data, plus imputed values for outcome
mod |>
augment()
## parameter estimates
library(dplyr)
mod |>
components() |>
filter(term == "datamod")
## the data have in fact been confidentialized,
## so we account for that, in addition
## to accounting for overcoverage
mod <- mod |>
set_confidential_rr3() |>
fit()
mod
Run the code above in your browser using DataLab