getfit returns the list of objects containing the repeated analysis results, or optionally, one of these fit objects.

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

Arguments

x

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

i

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

simplify

Should the return value be unlisted?

Value

If i = -1 an object of class mitml.result containing all analyses, otherwise it returns the fitted object of the i'th repeated analysis.

See also

Examples

imp <- mice(nhanes)
#> #> iter imp variable #> 1 1 bmi hyp chl #> 1 2 bmi hyp chl #> 1 3 bmi hyp chl #> 1 4 bmi hyp chl #> 1 5 bmi hyp chl #> 2 1 bmi hyp chl #> 2 2 bmi hyp chl #> 2 3 bmi hyp chl #> 2 4 bmi hyp chl #> 2 5 bmi hyp chl #> 3 1 bmi hyp chl #> 3 2 bmi hyp chl #> 3 3 bmi hyp chl #> 3 4 bmi hyp chl #> 3 5 bmi hyp chl #> 4 1 bmi hyp chl #> 4 2 bmi hyp chl #> 4 3 bmi hyp chl #> 4 4 bmi hyp chl #> 4 5 bmi hyp chl #> 5 1 bmi hyp chl #> 5 2 bmi hyp chl #> 5 3 bmi hyp chl #> 5 4 bmi hyp chl #> 5 5 bmi hyp chl
fit <- with(imp, lm(bmi~chl+hyp)) getfit(fit)
#> Component 1 : #> #> Call: #> lm(formula = bmi ~ chl + hyp) #> #> Coefficients: #> (Intercept) chl hyp #> 24.19642 0.01965 -1.55932 #> #> #> Component 2 : #> #> Call: #> lm(formula = bmi ~ chl + hyp) #> #> Coefficients: #> (Intercept) chl hyp #> 23.248 0.031 -2.326 #> #> #> Component 3 : #> #> Call: #> lm(formula = bmi ~ chl + hyp) #> #> Coefficients: #> (Intercept) chl hyp #> 19.16797 0.04634 -1.23530 #> #> #> Component 4 : #> #> Call: #> lm(formula = bmi ~ chl + hyp) #> #> Coefficients: #> (Intercept) chl hyp #> 19.09223 0.04044 -0.65796 #> #> #> Component 5 : #> #> Call: #> lm(formula = bmi ~ chl + hyp) #> #> Coefficients: #> (Intercept) chl hyp #> 20.86477 0.04226 -1.48968 #> #>
getfit(fit, 2)
#> #> Call: #> lm(formula = bmi ~ chl + hyp) #> #> Coefficients: #> (Intercept) chl hyp #> 23.248 0.031 -2.326 #>