Hierarchical clustering is a statistical method for finding relatively [[Homogeneity and heterogeneity#Homogeneity|homogeneous]] clusters. Hierarchical clustering consists of two separate phases. Initially, a [[distance matrix]] containing all the pairwise distances between the genes is calculated. [[Pearson product-moment correlation coefficient|Pearson’sPearson's correlation]] and [[Spearman's rank correlation coefficient|Spearman’sSpearman's correlation]] are often used as dissimilarity estimates, but other methods, like [[Taxicab geometry|Manhattan distance]] or [[Euclidean distance]], can also be applied. Given the number of distance measures available and their influence in the clustering algorithm results, several studies have compared and evaluated different distance measures for the clustering of microarray data, considering their intrinsic properties and robustness to noise.<ref name=Gentleman>{{cite book|last1=Gentleman|first1=Robert|title=Bioinformatics and computational biology solutions using R and Bioconductor|date=2005|publisher=Springer Science+Business Media|___location=New York|isbn=978-0-387-29362-2|display-authors=etal}}</ref><ref name=Jaskowiak2013>{{cite journal|last1=Jaskowiak|first1=Pablo A.|last2=Campello|first2=Ricardo J.G.B.|last3=Costa|first3=Ivan G.|title=Proximity Measures for Clustering Gene Expression Microarray Data: A Validation Methodology and a Comparative Analysis|journal=IEEE/ACM Transactions on Computational Biology and Bioinformatics|volume=10|issue=4|pages=845–857|doi=10.1109/TCBB.2013.9|pmid=24334380|year=2013|s2cid=760277}}</ref><ref name=Jaskowiak2014>{{cite journal|last1=Jaskowiak|first1=Pablo A|last2=Campello|first2=Ricardo JGB|last3=Costa|first3=Ivan G|title=On the selection of appropriate distances for gene expression data clustering|journal=BMC Bioinformatics|volume=15|issue=Suppl 2|pages=S2|doi=10.1186/1471-2105-15-S2-S2|pmid=24564555|pmc=4072854|year=2014}}</ref> After calculation of the initial distance matrix, the hierarchical clustering algorithm either (A) joins iteratively the two closest clusters starting from single data points (agglomerative, bottom-up approach, which is fairly more commonly used), or (B) partitions clusters iteratively starting from the complete set (divisive, top-down approach). After each step, a new distance matrix between the newly formed clusters and the other clusters is recalculated. Hierarchical cluster analysis methods include: