Skip to contents

Extract completed datasets from a gmm_imputation

Usage

gmm_complete(object, which = 1L)

Arguments

object

A gmm_imputation.

which

Either an integer vector of imputation indices, or "all" for every completion. Default 1L.

Value

When which selects one completion, a single completed dataset (matrix, or data frame if the input was one); otherwise a list of them.

Examples

x1 <- rnorm(60)
x2 <- x1 + rnorm(60, sd = 0.4)
x2[sample(60, 10)] <- NA
imp <- gmm_impute(cbind(x1, x2), N = 1L, m = 10L, seed = 1L)
first <- gmm_complete(imp, which = 1L)   # one completed dataset
anyNA(first)
#> [1] FALSE
all_completions <- gmm_complete(imp, which = "all")   # a list of ten
length(all_completions)
#> [1] 10