After calling a function such as mod_pois() or
set_prior() it is good practice to print the
model object at the console, to check the model's
structure. The output from print() has
the following components:
A header giving the class of the model and noting whether the model has been fitted.
A formula giving the outcome variable and terms for the model.
A table giving the number of parameters, and (fitted models only) the standard deviation across those parameters, a measure of the term's importance. See
priors()andtidy().Values for other model settings. See
set_disp(),set_var_age(),set_var_sexgender(),set_var_time(),set_n_draw()Details on computations (fitted models only). See
computations().
Usage
# S3 method for class 'bage_mod'
print(x, ...)Arguments
- x
Object of class
"bage_mod", typically created withmod_pois(),mod_binom(), ormod_norm().- ...
Unused. Included for generic consistency only.
See also
mod_pois()Specify a Poisson modelmod_binom()Specify a binomial modelmod_norm()Specify a normal modelfit.bage_mod() and
is_fitted()Model fittingaugment()Extract values for rates, probabilities, or means, together with original datacomponents()Extract values for hyper-parametersdispersion()Extract values for dispersionpriors Overview of priors for model terms
tidy.bage_mod() Number of parameters, and standard deviations
set_disp()Dispersionset_var_age(),set_var_sexgender(),set_var_time()Age, sex/gender and time variablesset_n_draw()Model draws
Examples
mod <- mod_pois(injuries ~ age + sex + year,
data = nzl_injuries,
exposure = popn)
## print unfitted model
mod
#>
#> ------ Unfitted Poisson model ------
#>
#> injuries ~ age + sex + year
#>
#> exposure: popn
#>
#> term prior along n_par n_par_free
#> (Intercept) NFix() - 1 1
#> age RW() age 12 12
#> sex NFix() - 2 2
#> year RW() year 19 19
#>
#> disp: mean = 1
#>
#> n_draw var_time var_age var_sexgender
#> 1000 year age sex
#>
mod <- fit(mod)
#> Building log-posterior function...
#> Finding maximum...
#> Drawing values for hyper-parameters...
## print fitted model
mod
#>
#> ------ Fitted Poisson model ------
#>
#> injuries ~ age + sex + year
#>
#> exposure: popn
#>
#> term prior along n_par n_par_free std_dev
#> (Intercept) NFix() - 1 1 -
#> age RW() age 12 12 0.76
#> sex NFix() - 2 2 0.71
#> year RW() year 19 19 0.09
#>
#> disp: mean = 1
#>
#> n_draw var_time var_age var_sexgender optimizer
#> 1000 year age sex nlminb
#>
#> time_total time_max time_draw iter converged message
#> 0.46 0.20 0.22 12 TRUE relative convergence (4)
#>