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

mixGuess

Naive imputation for mixed type data


Description

Naive imputation for mixed type data

Usage

mixGuess(missdata, method = c("mean", "majority"))

Arguments

missdata

a data matrix with missing values

method

a character vector of length 2 indicating which two methods to use respectively for continuous variables and categorical variables. There are three options for continous variables: "mean", "median" and "random", and two options for categorical varaibles: "majority" and "random". The default method is "mean" for the continous part and "majority" for the categorical part.

Value

the same size data matrix with no missing value.

Examples

data(tic)
missdata <- SimIm(tic, 0.1)
sum(is.na(missdata))
impdata <- mixGuess(missdata)
sum(is.na(impdata))

imputeR

A General Multivariate Imputation Framework

v2.2
GPL-3
Authors
Steffen Moritz [aut, cre] (<https://orcid.org/0000-0002-0085-1804>), Lingbing Feng [aut], Gen Nowak [ctb], Alan. H. Welsh [ctb], Terry. J. O'Neill [ctb]
Initial release
2020-01-20

We don't support your browser anymore

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