Become an expert in R — Interactive courses, Cheat Sheets, certificates and more!
Get Started for Free

getfit

Extract list of fitted models


Description

Function getfit() returns the list of objects containing the repeated analysis results, or optionally, one of these fitted objects. The function looks for a list element called analyses, and return this component as a list with mira class. If element analyses is not found in x, then it returns x as a mira object.

Usage

getfit(x, i = -1L, simplify = FALSE)

Arguments

x

An object of class mira, typically produced by a call to with().

i

An integer between 1 and x$m signalling the index of the repeated analysis. The default i= -1 return a list with all analyses.

simplify

Should the return value be unlisted?

Details

No checking is done for validity of objects. The function also processes objects of class mitml.result from the mitml package.

Value

If i = -1 an object of class mira containing all analyses. If i selects one of the analyses, then it return an object whose with class inherited from that element.

Author(s)

Stef van Buuren, 2012, 2020

See Also

Examples

imp <- mice(nhanes, print = FALSE, seed = 21443)
fit <- with(imp, lm(bmi ~ chl + hyp))
f1 <- getfit(fit)
class(f1)
f2 <- getfit(fit, 2)
class(f2)

mice

Multivariate Imputation by Chained Equations

v3.13.0
GPL-2 | GPL-3
Authors
Stef van Buuren [aut, cre], Karin Groothuis-Oudshoorn [aut], Gerko Vink [ctb], Rianne Schouten [ctb], Alexander Robitzsch [ctb], Patrick Rockenschaub [ctb], Lisa Doove [ctb], Shahab Jolani [ctb], Margarita Moreno-Betancur [ctb], Ian White [ctb], Philipp Gaffert [ctb], Florian Meinfelder [ctb], Bernie Gray [ctb], Vincent Arel-Bundock [ctb]
Initial release
2021-01-26

We don't support your browser anymore

Please choose more modern alternatives, such as Google Chrome or Mozilla Firefox.