set_prior {bage}R Documentation

Specify Prior for Model Term

Description

Specify a prior distribution for an intercept, a main effect, or an interaction.

Usage

set_prior(mod, formula)

Arguments

mod

A bage_mod object, created with mod_pois(), mod_binom(), or mod_norm().

formula

A formula giving the term and a function for creating a prior.

Details

If set_prior() is applied to a fitted model, set_prior() unfits the model, deleting existing estimates.

Value

A modified bage_mod object.

See Also

Examples

mod <- mod_pois(injuries ~ age + year,
                data = nzl_injuries,
                exposure = popn)
mod
mod |> set_prior(age ~ RW2())

[Package bage version 0.9.4 Index]