impute: Wrapper for the mice package

View source: R/impute.R

imputeR Documentation

Wrapper for the mice package

Description

Impute missing at random data using the mice package in a tidyverse approach.

Usage

impute(
  data,
  impute,
  fixed = NULL,
  ignore = NULL,
  quiet = T,
  m = 5,
  maxit = 5,
  meth = "pmm",
  seed = 500,
  ...
)

Arguments

data

Dataframe

impute

Vector of column names containing variables for use in the imputation algorithm and for imputation.

fixed

Optional vector of column names containing variables for use in the imputation algorithm but NOT for imputation.

ignore

Optional vector of column names containing variables NOT for use in the imputation algorithm OR for imputation.

quiet

Logical value to hide the output of the imputation process (default = T)

m

The number of imputations to be performed (default = 5)

maxit

is the number of iterations for each imputation (see mice::mice() function).

seed

random seed parameter which is useful for reproducibility.

...

Additional arguments to be passed to the mice::mice() function.

method

The imputation method to be used for each column in data (see mice::mice() function)

Value

Long dataset containing the original (unimputed) data, with each imputed dataset appended.


kamclean/finalpsm documentation built on Oct. 3, 2023, 3:52 a.m.