HypothesisTests.jl icon indicating copy to clipboard operation
HypothesisTests.jl copied to clipboard

Making CorrelationTest nonparametric

Open ayushpatnaikgit opened this issue 3 years ago • 2 comments

The cor function performs pearson rank correlation, which assumes that the datapoints are normally distributed. The corspearman performs the spearman rank correlation test, which doesn't assume any underlying distribution. The latter is more robust and better suited for this package.

ayushpatnaikgit avatar Jun 03 '21 13:06 ayushpatnaikgit

Why not allow both options, w the default being ‘corspearman’?

azev77 avatar Jun 06 '21 14:06 azev77

Just like "correlation" (and therefore cor) refers to the Pearson correlation most of the time, "correlation test" is generally taken to refer to the Pearson correlation. Could you (as @azev suggested) add an argument allowing users to pass the correlation function they want? And then tests to check that the result is correct (checking against another implementation)?

EDIT: Maybe we'd better add a new SpearmanCorrelationTest instead, as we'll also want Kendall's tau correlation test too at some point, which is very different in terms of formula from the Pearson correlation test.

nalimilan avatar Oct 02 '21 18:10 nalimilan

Closing in favor of #304.

nalimilan avatar Sep 09 '23 10:09 nalimilan