This function is not intended to be used by end user.
knn_nas_imp(
dat,
x,
nas_rate = NULL,
mat_nas_shadow = NULL,
dt_nas_random = NULL,
k = 10,
scale = FALSE,
method = "median",
miss_value_num = -1
)
A data.frame with independent variables.
The name of variable to process.
A list contains nas rate of each variable.
A shadow matrix of variables which contain nas.
A data.frame with random nas imputation.
Number of neighbors of each obs which x is missing.
Logical.Standardization of variable.
The methods of imputation by knn. "median" is knn imputation with k neighbors median, "avg_dist" is knn imputation with k neighbors of distance weighted mean.
Default value of missing data imputation for numeric variables, Defualt is -1.