bootImputeAnalyse  R Documentation 
Applies the user specified analysis function to each imputed dataset contained
in imps
, then calculates estimates, confidence intervals and pvalues
for each parameter, as proposed by von Hippel and Bartlett (2021).
bootImputeAnalyse(imps, analysisfun, nCores = 1, quiet = FALSE, ...)
imps 
The list of imputed datasets returned by 
analysisfun 
A function which when applied to a single dataset returns
the estimate of the parameter(s) of interest. The dataset to be analysed
is passed to 
nCores 
The number of CPU cores to use. If specified greater than one,

quiet 
Specify whether to print a table of estimates, confidence intervals and pvalues. 
... 
Other parameters that are to be passed through to 
Multiple cores can be used by using the nCores
argument, which may be
useful for reducing computation times.
A vector containing the point estimate(s), variance estimates, and degrees of freedom.
von Hippel PT, Bartlett JW. Maximum likelihood multiple imputation: faster, more efficient imputation without posterior draws. Statistical Science, 2021, 36(3):400420. \Sexpr[results=rd]{tools:::Rd_expr_doi("10.1214/20STS793")}
library(mice)
set.seed(564764)
#bootstrap twice and impute each twice
#in practice you should bootstrap many more times, e.g. at least 200
imps < bootMice(ex_linquad, nBoot=2, nImp=2)
#analyse estimates
#write a wapper to analyse an imputed dataset
analyseImp < function(inputData) {
coef(lm(y~z+x+xsq,data=inputData))
}
ests < bootImputeAnalyse(imps, analyseImp)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.