# how to interpret a hierarchical clustering in the heatmap in the picture bellow?

I am trying to interpret the heatmap which was created based on a agglomerative hierarchical clustering. I am not sure what exactly the heatmap does, having in mind that I see on left hand side clustering done on symptoms and on the top of the heatmap I get a clustering of the bellow labels.

Also, this is the code I have used to generate the heatmap:

library(pheatmap)
pheatmap(t(dt_wd[-1]), cluster_rows = TRUE, cluster_cols = TRUE, clustering_distance_cols = "euclidean",
clustering_distance_rows = "euclidean", clustering_method = "ward",  cutree_cols = 4,
main = "Cluster of comorbidities based on Covid-19 Symptoms")


This type of plot is refereed as Double Dendogram or Coloured Heatmap.

As seen in the code you have used Single Linkage Method for clustering.It yields clusters in which individuals are added sequentially to a single group.

From the example we can see that label dia2,ht and ob belong to one group but ht and ob are more correlated with each other.

I am not sure what exactly the heatmap does

The color of a cell is proportional to its position along a color gradient. Heatmap is helpful in finding the correlation coefficient. It can helps us to visualize the difference in value within clusters. It's more like a color representation of value.

• I thought it is the ward method - as you can see this passed to the parameter clustering_method = "ward". My misunderstanding though is - if you see on the left hand side - it does cluster the symptoms as well, not only he comorbidities. Therefore, can I say a comorbidity cluster is correlated with a cluster of symptoms? – GaB Sep 8 at 16:00
• Ward method is nothing but Single linkage method. We can say that we are looking into correlation within clusters but it's mostly used used when you need to visualise both row and column variables in same dendogram. Hope this answers your question. – prashant0598 Sep 8 at 16:50
• Can you please point out to a paper with the example? – GaB Sep 8 at 16:56
• You can refer this document : ncss-wpengine.netdna-ssl.com/wp-content/themes/ncss/pdf/… – prashant0598 Sep 8 at 17:00
• Yes,the left one is clusters for symtoms and top one is for labels. If this helped you pls upvote or accept the answer :) – prashant0598 Sep 8 at 17:32