HypothesisTests.jl
HypothesisTests.jl copied to clipboard
Making CorrelationTest nonparametric
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.
Why not allow both options, w the default being ‘corspearman’?
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.
Closing in favor of #304.