Take the 2-minute tour ×
Cross Validated is a question and answer site for people interested in statistics, machine learning, data analysis, data mining, and data visualization. It's 100% free, no registration required.

Wikipedia has a Fisher transform of the Spearman rank correlation to an approximate z-score. Perhaps that z-score is the difference from null hypothesis (rank correlation 0)?

This page has the following example:

4, 10, 3, 1, 9, 2, 6, 7, 8, 5
5, 8, 6, 2, 10, 3, 9, 4, 7, 1
rank correlation 0.684848
"95% CI for rho (Fisher's z transformed)= 0.097085 to 0.918443"

How do they use the Fisher transform to get the 95% confidence interval?

share|improve this question

1 Answer 1

up vote 7 down vote accepted

In a nutshell, a 95% confidence interval is given by
$$\tanh(\operatorname{arctanh}r\pm1.96/\sqrt{n-3}),$$ where $r$ is the estimate of the correlation and $n$ is the sample size.

Explanation: The Fisher transformation is arctanh. On the transformed scale, the sampling distribution of the estimate is approximately normal, so a 95% CI is found by taking the transformed estimate and adding and subtracting 1.96 times its standard error. The standard error is (approximately) $1/\sqrt{n-3}$.

EDIT: The example above in Python:

import math
r = 0.684848
num = 10
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)

gives

lower 0.097071 upper 0.918445

which agrees with your example to 4 decimal places.

share|improve this answer
    
One question: how does the 1.06 in en.wikipedia.org/wiki/… relate to your answer? –  dfrankow Nov 26 '11 at 18:44
    
You've got me there! I don't know to be honest; i just tried it with and without and it matched the example results you gave much better without. –  onestop Nov 26 '11 at 20:43
1  
@dfrankow I have accepted that edit, but this is not a perfect use of this feature -- the better idea is to add such text to the question. –  mbq Nov 27 '11 at 9:54
3  
@dfrankow About the 1.06 value: It seems Wikipedia is referring to Fieller et al.'s Biometrika paper where the estimate of the population variance of $\hat\zeta=\text{tanh}^{-1}\hat\theta$ ($\hat\theta$ is the correlation estimate) is defined as $\sigma^2_{\hat\zeta}\approx 1.06/(n-3)$, but see Bonnett and Wright, Sample size requirements for estimating pearson, kendall and spearman correlations, Psychometrika 65(1):23, 2000. –  chl Nov 27 '11 at 10:31

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.