compute Spearman correlation