set_prior: Specify Prior for Model Term

View source: R/bage_mod-functions.R

set_priorR 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, it 'unfits' the model, deleting existing estimates.

Value

A modified bage_mod object.

See Also

  • priors Current choices for prior distributions

  • is_fitted() Test whether a model is fitted

  • set_disp() Specify prior for dispersion

Examples

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

bage documentation built on April 3, 2025, 8:53 p.m.