library(bage)
#> Loading required package: rvec
#>
#> Attaching package: 'rvec'
#> The following objects are masked from 'package:stats':
#>
#> sd, var
#> The following object is masked from 'package:base':
#>
#> rank
library(rvec)
library(dplyr)
#>
#> Attaching package: 'dplyr'
#> The following objects are masked from 'package:stats':
#>
#> filter, lag
#> The following objects are masked from 'package:base':
#>
#> intersect, setdiff, setequal, union
library(ggplot2)
mod <- mod_pois(injuries ~ age : sex + age : ethnicity + year,
data = nzl_injuries,
exposure = popn) |>
set_prior(year ~ AR1())
mod
#>
#> ------ Unfitted Poisson model ------
#>
#>
#> injuries ~ age:sex + age:ethnicity + year
#>
#> exposure = popn
#>
#>
#> term prior along n_par n_par_free
#> (Intercept) NFix() - 1 1
#> year AR1() year 19 19
#> age:sex RW() age 24 22
#> age:ethnicity RW() age 24 22
#>
#>
#> n_draw pr_mean_disp var_time var_age var_sexgender
#> 1000 1 year age sex