induce_informative_missing {AutoScore}R Documentation

Internal function: induce informative missing to sample data in the package to demonstrate how AutoScore handles missing as a separate category

Description

Internal function: induce informative missing to sample data in the package to demonstrate how AutoScore handles missing as a separate category

Usage

induce_informative_missing(
  df,
  vars_to_induce = c("Lab_A", "Vital_A"),
  prop_missing = 0.4
)

Arguments

df

A data.frame of sample data.

vars_to_induce

Names of variables to induce informative missing in. Default is c("Lab_A", "Vital_A").

prop_missing

Proportion of missing to induce for each vars_to_induce. Can be a single value for a common proportion for all variables (default is 0.4), or a vector with same length as vars_to_induce.

Details

Assume subjects with normal values (i.e., values close to the median) are more likely to not have measurements.

Value

Returns df with selected columns modified to have missing.


[Package AutoScore version 1.0.0 Index]