Become an expert in R — Interactive courses, Cheat Sheets, certificates and more!
Get Started for Free

initialise

Initialization of missing values


Description

Rough estimation of missing values in a vector according to its type.

Usage

initialise(x, mixed, method = "kNN", mixed.constant = NULL)

Arguments

x

a vector.

mixed

a character vector containing the names of variables of type mixed (semi-continous).

method

Method used for Initialization (median or kNN)

mixed.constant

vector with length equal to the number of semi-continuous variables specifying the point of the semi-continuous distribution with non-zero probability

Details

Missing values are imputed with the mean for vectors of class "numeric", with the median for vectors of class "integer", and with the mode for vectors of class "factor". Hence, x should be prepared in the following way: assign class "numeric" to numeric vectors, assign class "integer" to ordinal vectors, and assign class "factor" to nominal or binary vectors.

Value

the initialized vector.

Note

The function is used internally by some imputation algorithms.

Author(s)

Matthias Templ, modifications by Andreas Alfons


VIM

Visualization and Imputation of Missing Values

v6.1.0
GPL (>= 2)
Authors
Matthias Templ [aut, cre], Alexander Kowarik [aut] (<https://orcid.org/0000-0001-8598-4130>), Andreas Alfons [aut], Gregor de Cillia [aut], Bernd Prantner [ctb], Wolfgang Rannetbauer [aut]
Initial release

We don't support your browser anymore

Please choose more modern alternatives, such as Google Chrome or Mozilla Firefox.