imputed {gerbil} | R Documentation |
Extracting imputed datasets from gerbil objects
Description
Using a gerbil
object as an input, this function returns imputed datasets.
Usage
imputed(gerb, imp = 1)
Arguments
gerb |
A |
imp |
The imputed datasets which are to be returned (defaults to |
Details
The function either return a single imputed dataset (if imp
is a scalar) or a tall dataset if (if imp
is a vector) with the individual datsets stacked on top of each other.
Value
imputed()
returns a data frame or matrix. If imp
has multiple elements, columns are added to indicate the imputation number and the case ID.
Examples
#Load the India Human Development Survey-II dataset
data(ihd_mcar)
# Create a gerbil object
imps.gerbil <- gerbil(ihd_mcar, m = 5, ords = "education_level", semi = "farm_labour_days",
bincat = "job_field", n.cores = 1)
# Return a single imputed datasets
imp.gerb <- imputed(imps.gerbil, imp = 2)
# Return multiple (stacked) datasets
imp.gerb <- imputed(imps.gerbil, imp = 1:5)