imputed function

Extracting imputed datasets from gerbil objects

Extracting imputed datasets from gerbil objects

Using a gerbil object as an input, this function returns imputed datasets.

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.

Returns

imputed() returns a data frame or matrix. If imp has multiple elements, columns are added to indicate the imputation number and the case ID.

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.

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)
  • Maintainer: Michael Robbins
  • License: GPL-2
  • Last published: 2023-01-12

Useful links