[Top][All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Help-gsl] Spearman rank correlation coefficient

From: Timothée Flutre
Subject: [Help-gsl] Spearman rank correlation coefficient
Date: Thu, 9 Feb 2012 17:26:27 -0600


I noticed that only the Pearson correlation coefficient is implemented
in the GSL (
However, in quantitative genetics, several authors are using the
Spearman coef (for instance, Stranger et al "Population genomics of
human gene expression", Nature Genetics, 2007) as it is less
influenced by outliers.

Current high-throughput data requires to compute such coef several
millions of times. Thus I implemented the computation of the Spearman
coef in GSL-like code. In fact, one just need to rank the input
vectors and then compute the Pearson coef on them. For the ranking, I
got inspired by the code from the Apache Math module.

I was thinking that it could be useful to other users to add my piece
of code to the file "covariance_source.c" of the GSL
So here is the code:

I am not very proficient in C, so even if it is not possible to
include the code in the GSL, don't hesitate to give me advice.


reply via email to

[Prev in Thread] Current Thread [Next in Thread]