I have been looking online for tutorial but the result is not correct
d <- dist(USArrests, method = "euclidean") # distance matrix
usarrests_hi_cluster <- hclust(d, method="complete")
plot(usarrests_hi_cluster)
This works fine and I get the whole dendogram
but when I do the following to prune at certain height
my_dend<-cutree(usarrests_hi_cluster, h = 150)
print(my_dend)
only get a list of the states with a number
Alabama Alaska Arizona Arkansas
1 1 1 2
California Colorado Connecticut Delaware
1 2 3 1
Florida Georgia Hawaii Idaho
1 2 3 3
Illinois Indiana Iowa Kansas
1 3 3 3
Kentucky Louisiana Maine Maryland
3 1 3 1
I want to cut the dendogram at a certain height to get 3 clusters and plot it
I am tryingt to answer this question
(b) Cut the dendrogram at a height that results in three distinct clusters. Which states belong to which clusters?