bootSmcfcs {bootImpute}R Documentation

Bootstrap then impute using smcfcs

Description

Bootstraps an incomplete dataset and then imputes each bootstrap a number of times using the smcfcs package. The resulting list of bootstrapped then imputed datasets can be analysed with bootImputeAnalyse. To run this function requires the smcfcs package to be installed.

Usage

bootSmcfcs(obsdata, nBoot = 200, nImp = 2, nCores = 1, seed = NULL, ...)

Arguments

obsdata

The data frame to be imputed.

nBoot

The number of bootstrap samples to take. It is recommended that you use a minimum of 200. If you specify nCores>1, nBoot must be a multiple of the specified nCores value.

nImp

The number of times to impute each bootstrap sample. Two is recommended.

nCores

The number of CPU cores to use. If specified greater than one, bootImpute will impute using the number of cores specified.

seed

Random number seed.

...

Other arguments that are to be passed to smcfcs.

Value

A list of imputed datasets.

Examples

library(smcfcs)

head(ex_linquad)
#bootstrap twice and impute each twice
#in practice you should bootstrap many more times, e.g. at least 200
imps <- bootSmcfcs(ex_linquad, nBoot=2, nImp=2,
                   smtype="lm", smformula="y~z+x+xsq",
                   method=c("","","norm","x^2",""), seed=564764)

[Package bootImpute version 1.2.0 Index]