bootSmcfcs | R Documentation |
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.
bootSmcfcs(obsdata, nBoot = 200, nImp = 2, nCores = 1, seed = NULL, ...)
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 |
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 |
A list of imputed datasets.
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)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.