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 gerbil object containing the imputed data.

imp

The imputed datasets which are to be returned (defaults to imp = 1). Letting m indicate the number of imputed datasets contained in gerb, imp should be a subset of 1:m. If imp is a scalar, a single imputed dataset is returned. If imp is a vector, then the individual datasets are stacked on top of each other and returned.

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)



[Package gerbil version 0.1.9 Index]