Learn R Programming

bage (version 0.9.0)

unfit: Unfit a Model

Description

Reset a model, deleting all estimates.

Usage

unfit(mod)

Value

An unfitted version of mod.

Arguments

mod

A fitted object of class "bage_mod", object, created through a call to mod_pois(), mod_binom(), or mod_norm().

See Also

  • fit() Fit a model

  • mod_pois(), mod_binom(), mod_norm() Specify a model

  • Functions such as set_prior(), set_disp() and set_var_age() unfit models as side effects.

Examples

Run this code
## create a model, which starts out unfitted
mod <- mod_pois(injuries ~ age + sex + year,
                data = nzl_injuries,
                exposure = popn)
is_fitted(mod)

## calling 'fit' produces a fitted version
mod <- fit(mod)
is_fitted(mod)

## calling 'unfit' resets the model
mod <- unfit(mod)
is_fitted(mod)

Run the code above in your browser using DataLab