impute_missing_data: Impute Missing Data

View source: R/impute_missing_data.R

impute_missing_dataR Documentation

Impute Missing Data

Description

Filter out rows with too much missing data, impute the remaining missing values

Usage

impute_missing_data(
  data = NULL,
  covars = NULL,
  max_missing = 3,
  impute_vars = NULL,
  method = c("Hmisc", "missForest", "randomForestSRC"),
  ntree = 100,
  nk = 4,
  ...
)

Arguments

data

data.frame containing covars and any impute_vars as columns

covars

vector of covariate names to be imputed, which match column names in data

max_missing

integer value of the maximum number of columns per row that may have missing values. Rows with more than this number of missing covariates will be deleted.

impute_vars

additional covariates included in data that may be used for imputation

method

which method to use, either by creating random forests using the missForest package, or by predictive mean matching using the aregImpute function in the Hmisc package

ntree

how many trees to build if method = 'missForest' or method == 'randomForestSRC'

nk

how many knots to use in smoothing splines if using method = 'Hmisc'

...

other arguments to be passed to either missForest, aregImpute or impute functions

Value

data.frame containing non-missing and imputed data

Author(s)

Kevin See


KevinSee/QRFcapacity documentation built on Feb. 27, 2023, 3:57 p.m.