update.chantrics: Update, re-fit and re-adjust a Model Call

Description Usage Arguments Details Value See Also Examples

View source: R/adj_loglik_methods.R

Description

update.chantrics() will update a model that has been adjusted by adj_loglik(). It passes all arguments to the standard stats::update() function.

Usage

1
2
## S3 method for class 'chantrics'
update(object, ...)

Arguments

object

A "chantrics" returned by adj_loglik().

...

Additional arguments to the call, passed to stats::update() to update the original model specification.

Details

The function cannot change any arguments passed to the adj_loglik() function. To change any of these arguments, re-run adj_loglik().

Passing evaluate = FALSE is not supported, if this is required, run stats::update() on the unadjusted object.

Value

The fitted, adjusted "chantrics" object.

See Also

stats::update()

stats::update.formula()

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
# from Introducing Chandwich.
set.seed(123)
x <- rnorm(250)
y <- rnbinom(250, mu = exp(1 + x), size = 1)
fm_pois <- glm(y ~ x + I(x^2), family = poisson)
fm_pois_adj <- adj_loglik(fm_pois)
fm_pois_small_adj <- update(fm_pois_adj, formula = . ~ . - I(x^2))
summary(fm_pois_small_adj)
fm_pois_smallest_adj <- update(fm_pois_adj, formula = . ~ 1)
summary(fm_pois_smallest_adj)

chantrics documentation built on Sept. 29, 2021, 9:08 a.m.