1. Learn
  2. /
  3. Courses
  4. /
  5. Cluster Analysis in R

Connected

Exercise

Hierarchical clustering: Occupation trees

In the previous exercise you have learned that the oes data is ready for hierarchical clustering without any preprocessing steps necessary. In this exercise you will take the necessary steps to build a dendrogram of occupations based on their yearly average salaries and propose clusters using a height of 100,000.

Instructions

100 XP
  • Calculate the Euclidean distance between the occupations and store this in dist_oes.
  • Run hierarchical clustering using average linkage and store in hc_oes.
  • Create a dendrogram object dend_oes from your hclust result using the function as.dendrogram().
  • Plot the dendrogram.
  • Using the color_branches() function create & plot a new dendrogram with clusters colored by a cut height of 100,000.