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{
nnodes <- 2 # Number of CPU cores used for parallel computation
# Multiple imputation using m = 100 (should be larger in practice)
res.imp.over <- imputedata(data.na = wine.na,
nb.clust = nb.clust,
m = 100)
# Overimputation
## overimputed variable
plotvars <- "alco"
## selection of 20 complete individuals on variable "alco"
plotinds <- sample(which(!is.na(wine.na[, plotvars])),
size = 20)
## overimputation
res.over <- overimpute(res.imp.over,
nnodes = nnodes,
plotvars = plotvars,
plotinds = plotinds,
)
# }
Run the code above in your browser using DataLab