nn.impute {SAGx} | R Documentation |
The function uses the k nearest neighbours to calculate an average which is imputed.
nn.impute(data = d, k = 5, na.rate = 0.5, normalise = TRUE)
data |
the data matrix containing NA's, with variables in columns |
k |
the number of neighbours to use |
na.rate |
The maximum na.rate tolerated |
normalise |
if TRUE, the matrix will be normalised by column to unit variance |
Variables not satisfying the na.rate condition will be excluded
A data matrix with imputed values
Per Broberg
Troyanskaya O, Cantor M, Sherlock G, Brown P, Hastie T, Tibshirani R, Botstein D, Altman RB: Missing value estimation methods for DNA microarrays, Bioinformatics 2001 Jun;17(6):520-5