data(CHEM97Na)
ind.clust <- 1#index for the cluster variable
#initialisation of the argument predictorMatrix
predictor.matrix <- mice(CHEM97Na, m = 1, maxit = 0)$pred
predictor.matrix[ind.clust,ind.clust] <- 0
predictor.matrix[-ind.clust,ind.clust] <- -2
predictor.matrix[predictor.matrix==1] <- 2
#initialisation of the argument method
method <- find.defaultMethod(CHEM97Na, ind.clust)
print(method)
#multiple imputation by chained equations (parallel calculation)
#res.mice <- mice.par(CHEM97Na, m = 3, predictorMatrix = predictor.matrix, method = method)
Run the code above in your browser using DataLab