set.seed(0)
## specify model
mod <- mod_pois(injuries ~ age + sex + year,
data = nzl_injuries,
exposure = popn)
## prior distribution
mod |>
dispersion()
## fit model
mod <- mod |>
fit()
## posterior distribution
mod |>
dispersion()
## fit normal model
mod <- mod_norm(value ~ age * diag + year,
data = nld_expenditure,
weights = 1) |>
fit()
## values on the transformed scale
mod |>
dispersion()
## values on the original scale
mod |>
dispersion(original_scale = TRUE)
Run the code above in your browser using DataLab