I want to determine the best k for clustering using NbClust package.My data have both continuous and categorical variables so I use the dissimilarity matrix which has been calculated using daisy() from cluster package. I used the code bellow:
res.nb <- NbClust(gower_dist_gender, min.nc = 1,
max.nc = 5,method = "complete", index ="all")
And come across this error:
The TSS matrix is indefinite. There must be too many missing values. The
index cannot be calculated.
What is the problem and how should I fix it? In addition consider that when I set the index to "silhouette", no problem was occured and give back the best k as 2. But I want to use index="all" to ensure the result of best k according to most of the indexes.(When the index is set to "all" 26 indexes are considered as index an the result shows the majority vote of indexes on the number of k). So the question is why running the code above which set the index as "all" comes across the error mentioned before?
Any little help would be greatly appreciated.