na_filler_contvar: Variable NA Filler

Description Usage Arguments Examples

Description

This function allows you to fill the missing values of a continuous variable for a given data set. According to the Kolmogorov-Smirnov test, if the variable is distributed normally, the NA values are filled with the mean value, otherwise they are filled with the median value.

Usage

1
na_filler_contvar(data, variable, pvalue = 0.05)

Arguments

data

A data set needs to be defined.

variable

A variable need to be defined as a string.

pvalue

A p-value threshold need to be defined.

Examples

1
2
3
4
5
name <- c('John Doe','Peter Gynn','Jolie Hope')
birth_year <- c(1980, 1985, 1971)
salary <- c(20000,NA,10000)
example_data <- data.frame(name,birth_year,salary)
na_filler_contvar(example_data,"salary")

ayhandis/creditR documentation built on May 9, 2019, 8:41 a.m.