biokNN_impute: Impute multilevel dataset

Description Usage Arguments Value Examples

View source: R/impute.R

Description

This function returns a dataframe with a complete dataset, where the missing values are imputed using a bi-objective kNN method. It assumes that the class variable is complete and its name is known, and the rest of the variables are numerical.

Usage

1
2
3
4
5
6
7
8
9
biokNN_impute(
  data,
  className,
  varNames,
  nIter = 10,
  alpha = 0.5,
  k = 10,
  distance = "gower"
)

Arguments

data

A dataframe with missing values

className

name of the variable that contains the classes

varNames

vector with the names of the variables to be imputed

nIter

number of iterations, default = 10

alpha

weight of the kNN values in the objective function, default = 0.5

k

number of nearest neighbours, default = 10

distance

distance function used to get the k-nearest neighbors

Value

A dataframe with the imputed data

Examples

1
2
3
4
5
6
7
8
data(data_example)
complete_data <- biokNN_impute(data.example,
               className = "class",
               varNames = c("y"),
               nIter = 10,
               alpha = 0.9,
               k = 15,
               distance = "gower")

mcubillos3/biokNN documentation built on Dec. 21, 2021, 4:50 p.m.