help-gsl
[Top][All Lists]
Advanced

[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

Hello,

I noticed that only the Pearson correlation coefficient is implemented
in the GSL (http://www.gnu.org/software/gsl/manual/html_node/Correlation.html).
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
(http://bzr.savannah.gnu.org/lh/gsl/trunk/annotate/head:/statistics/covariance_source.c#L77).
So here is the code: https://gist.github.com/1784199

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.

Thanks,
Tim



reply via email to

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