impute_net: Elastic net imputation

Description Usage Arguments

View source: R/impute_net.R

Description

glmnet is used to impute missing values. For more details, see glmnet

Usage

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
impute_net(
  data_ref,
  data_new = NULL,
  fit = NULL,
  cols = dplyr::everything(),
  df_min = 1,
  df_max = 10,
  df_stp = 1,
  restore_data = TRUE,
  verbose = 1
)

Arguments

data_ref

a data frame.

data_new

an optional data frame. If supplied, then data_ref will be used as a reference dataset for data_new and the output will contain imputed values for data_new. If not supplied, the output will contain imputed values for data_ref.

fit

a list of lists of strings that contain formulas from previously fitted imputation models. This input variable is created using data_ref when data_new = NULL.

cols

columns that should be imputed and/or used to impute other columns. Supports tidy select functions (see examples).

df_min, df_max

integer value designating the minimum and maximum degrees of freedom in penalized regression models.

df_stp

integer value indicating step size for model degrees of freedom between successive imputations.

restore_data

a logical value. If TRUE, the variable types of the imputed values will match those of the original data. If FALSE, the imputed values are returned in a one-hot encoded format.

verbose

an integer value of 0, 1, or 2. If verbose = 0, nothing is printed. If verbose = 1, messages are printed to the console showing what general steps are being taken in the imputation process. If verbose = 2, all relevant information on convergence is printed in addition to general messages.


bcjaeger/ipa documentation built on May 7, 2020, 9:45 a.m.