data(wine, package = "clusterMI")
require(parallel)
set.seed(123456)
ref <- wine$cult
nb.clust <- 3
wine.na <- wine
wine.na$cult <- NULL
wine.na <- prodna(wine.na)
# \donttest{
# imputation
m <- 5 # number of imputed data sets. Should be larger in practice
res.imp <- imputedata(data.na = wine.na, nb.clust = nb.clust, m = m)
# cluster analysis by kmeans and pooling
nnodes <- 2 # Number of CPU cores for parallel computing
res.pool <- clusterMI(res.imp, nnodes = nnodes)
res.pool$instability
table(ref, res.pool$part)
# choice of nb.clust
res.nbclust <- choosenbclust(res.pool)
res.nbclust$nb.clust
# }
Run the code above in your browser using DataLab