Created
February 17, 2017 23:29
-
-
Save Bollegala/01fa1520d4c1594c12d39905a463469f to your computer and use it in GitHub Desktop.
Fisher confidence intervals for Spearman correlation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import math | |
import sys | |
r = float(sys.argv[1]) | |
num = int(sys.argv[2]) | |
stderr = 1.0 / math.sqrt(num - 3) | |
delta = 1.96 * stderr | |
lower = math.tanh(math.atanh(r) - delta) | |
upper = math.tanh(math.atanh(r) + delta) | |
print "lower %.6f upper %.6f" % (lower, upper) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment