HypothesisTests.jl
HypothesisTests.jl copied to clipboard
Spearman cor test
This PR adds the SpearmanCorrelationTest as suggested in #236.
For the confidence interval I took inspiration from this StackExchange thread and used the suggested variance estimator to counter the non-normal distribution of the ranks.
Unfortunately, I could not really add meaningful tests for it as R's cor.test does not give the intervals for Spearman correlation and uses another algorithm to calculate the p-value as well. Maybe someone has an idea here or knows a tool that can calculate this already correctly.
Codecov Report
Patch coverage: 100.00% and project coverage change: +0.06 :tada:
Comparison is base (
932eaac) 93.75% compared to head (8869900) 93.81%.
Additional details and impacted files
@@ Coverage Diff @@
## master #304 +/- ##
==========================================
+ Coverage 93.75% 93.81% +0.06%
==========================================
Files 28 28
Lines 1729 1746 +17
==========================================
+ Hits 1621 1638 +17
Misses 108 108
| Impacted Files | Coverage Δ | |
|---|---|---|
| src/correlation.jl | 100.00% <100.00%> (ø) |
:umbrella: View full report in Codecov by Sentry.
:loudspeaker: Do you have feedback about the report comment? Let us know in this issue.
Thanks for your detailed review! I tried to incorporate it as suggested.
I used the spearmanCI R library to get values for the CIs for testing. They suffer from the same problem as the p value, as they have a low number of matching significant digits. I still wrote the tests as a form of documentation and also added tests to compare against the vales we return to catch feature changes/bugs etc.
Also mention now the ordinal data as it is the main message of the Ruscio paper (Now added to docstring).
Hello, how is this different from https://github.com/JuliaStats/HypothesisTests.jl/pull/53 ?
@mapi1 thanks for the PR. Do you foresee you'll have the opportunity to move it forward? cheers
I mentioned a temporary solution in #213.
Forgot to mention that I ignore the confidence interval CorrelationTest gives.
Validated by comparing results from corspearman and SPSS.