# NOT RUN {
require(VarSelLCM)
# Data loading:
# x contains the observed variables
# z the known statu (i.e. 1: absence and 2: presence of heart disease)
data(heart)
ztrue <- heart[,"Class"]
x <- heart[,-13]
# Cluster analysis with variable selection (with parallelisation)
res_with <- VarSelCluster(x, 2, nbcores = 2, initModel=40)
# Summary of the probabilities of missclassification
plot(res_with, type="probs-class")
# Discriminative power of the variables (here, the most discriminative variable is MaxHeartRate)
plot(res_with)
# Boxplot for the continuous variable MaxHeartRate
plot(res_with, y="MaxHeartRate")
# Empirical and theoretical distributions (to check that the distribution is well-fitted)
plot(res_with, y="MaxHeartRate", type="cdf")
# Summary of categorical variable
plot(res_with, y="Sex")
# }
Run the code above in your browser using DataLab