VarSelImputation function

Imputation of missing values

Imputation of missing values

This function permits imputation of missing values in a dataset by using mixture model. Two methods can be used for imputation:

  • posterior mean (method="postmean")
  • sampling from the full conditionnal distribution (method="sampling")
VarSelImputation(obj, newdata, method = "postmean")

Arguments

  • obj: an instance of VSLCMresults which defines the model used for imputation.
  • newdata: data.frame Dataset containing the missing values to impute.
  • method: character definiting the method of imputation: "postmean" or "sampling"

Examples

# Data loading data("heart") # Clustering en 2 classes results <- VarSelCluster(heart[,-13], 2) # Data where missing values will be imputed newdata <- heart[1:2,-13] newdata[1,1] <- NA newdata[2,2] <- NA # Imputation VarSelImputation(results, newdata)