Become an expert in R — Interactive courses, Cheat Sheets, certificates and more!
Get Started for Free

rangerImpute

Random Forest Imputation


Description

Impute missing values based on a random forest model using ranger::ranger()

Usage

rangerImpute(
  formula,
  data,
  imp_var = TRUE,
  imp_suffix = "imp",
  ...,
  verbose = FALSE,
  median = FALSE
)

Arguments

formula

model formula for the imputation

data

A data.frame containing the data

imp_var

TRUE/FALSE if a TRUE/FALSE variables for each imputed variable should be created show the imputation status

imp_suffix

suffix used for TF imputation variables

...

Arguments passed to ranger::ranger()

verbose

Show the number of observations used for training and evaluating the RF-Model. This parameter is also passed down to ranger::ranger() to show computation status.

median

Use the median (rather than the arithmetic mean) to average the values of individual trees for a more robust estimate.

Value

the imputed data set.

See Also

Other imputation methods: hotdeck(), irmi(), kNN(), matchImpute(), regressionImp()

Examples

data(sleep)
rangerImpute(Dream+NonD~BodyWgt+BrainWgt,data=sleep)

VIM

Visualization and Imputation of Missing Values

v6.1.0
GPL (>= 2)
Authors
Matthias Templ [aut, cre], Alexander Kowarik [aut] (<https://orcid.org/0000-0001-8598-4130>), Andreas Alfons [aut], Gregor de Cillia [aut], Bernd Prantner [ctb], Wolfgang Rannetbauer [aut]
Initial release

We don't support your browser anymore

Please choose more modern alternatives, such as Google Chrome or Mozilla Firefox.