Dissimilarity functions for rank-invariant hierarchical clustering of continuous variables