compare_model: Compare summary statistics between various imputation methods

Description Usage Arguments Value Author(s) See Also Examples

View source: R/hamr.R

Description

This function will call function 'impute_missing()' for several methods and return a table with some statistical information of the specified feature before and after imputation of different methods

Usage

1
compare_model(df, feature, methods, missing_val_char)

Arguments

df

A dataset with missing values that needs to be imputed.

feature

(str) A string of column name, if the input data is a matrix, this should be a string like "Vn" where n is an integer representing the index of column

methods

(str or list)– the methods that users want to compare Supporting methods are: CC - Complete Case MIP - Imputation with mean value DIP - Imputation with median value

missing_val_char

A string of a missing value format: Supporting types are: NaN - Not a Number "" - Blank "?" - Question mark

Value

a summary table comparing the summary statistics: count, mean, std, min, 25%, 50%, 75%, max.

Author(s)

Duong Vu, 2018

See Also

na.omit for the complete case

Other aggregate functions: impute_missing

Examples

1
compare_model(data.frame(ex = c(1, 2, 3), bf = c(6, 8, "")), "bf", "DIP", "")

UBC-MDS/hamr documentation built on May 25, 2019, 1:36 p.m.