CAssociation · Guide test 081
Fisher r to z comparison test
Compares independent correlations after Fisher’s approximately normalizing transformation.
Do it in CodeSplash
In the app, set it up in Analyze with this method:
- Compare two correlations (Fisher z, Williams, Steiger) — Is one correlation stronger than another?
In Compare two correlations (Fisher z, Williams, Steiger), choose Test = Fisher r-to-z (independent samples).
Do it in CodeSplash Run this test on your own data, in Python or R.
Bench
Change the design, drag the data, move α. The statistic, its reference distribution and the verdict follow.
Bench · Fisher r to z comparison test
Alternative
Your data
Two independent samples| Sample | n | r |
|---|---|---|
| 1 | 50.000 | 0.524 |
| 2 | 60.000 | 0.203 |
two samples: n₁ = 50 (r = 0.52), n₂ = 60 (r = 0.20)
If H₀ were true
- The reference: how z varies across samples when H₀ is true.
- Your statistic, from the data above.
- The p-value: the area at least as extreme as yours (p = .056).
- The hatched rejection region at α = .050: statistics landing here reject H₀.
The formula
With your numbers
- Fisher's z: near-normal with variance 1/(n − 3)
- the two sample sizes
The verdict
z = 1.91, p = .056, q = 0.38
p > α = .050: compatible with H₀
Effect size: Cohen's q (difference of Fisher z) q = 0.376
Fisher's transform makes correlations roughly normal with known variance, so the difference is a z test. Only for independent samples; correlations from the same people need Williams or Steiger.
- Statistic
- 1.909
- p-value
- 0.0563
Fisher r to z comparison test on two samples: n₁ = 50 (r = 0.52), n₂ = 60 (r = 0.20): z = 1.91, p = .056, q = 0.38. The p-value is above α = .050, so the data are compatible with H₀.
Question and hypotheses
H0: two independent population Pearson correlations are equal.
Assumptions
Independent samples; approximately bivariate normal data and adequate sample sizes greater than three.
Formula
Parameters and notation
atanh(r)=½log[(1+r)/(1−r)]; r1,r2 are sample correlations.
Structure of the method
Transform each independent sample correlation with atanh, subtract the transformed estimates, and divide by the square root of the sum of approximate variances 1/(n-3). A standard-normal tail then compares the two population correlations under the stated large-sample model.
Estimated and nuisance parameters
Estimate one correlation in each independently sampled population; their sample sizes determine the approximate transformed variances. Marginal locations and scales are nuisance quantities absorbed by correlation. Correlations exactly at plus or minus one make the transformation infinite and require substantive data inspection.
Settings and design choices
Prespecify the two populations, variables, direction, confidence level, and missing-data rules. Equal sample sizes are unnecessary, but both must exceed three and provide adequate information. The comparison concerns correlation strength on a transformed scale, not equality of regression slopes.
Fitting and adaptation
Recompute each correlation after sampling changes. A bootstrap can resample pairs independently within each population, preserving within-pair association and between-population independence. There is no fine-tuning. Shared subjects require a dependent-correlation method because the displayed variance sum omits their covariance.
Sensitivity and robustness
Small samples, nonnormality, outliers, and range restriction can distort the approximation or interpretation. A difference in measurement reliability can produce different correlations without a different underlying mechanism. Report both estimates and intervals, not just a significant difference statistic.
How to use and calibrate
Use a standard normal tail and a confidence interval for the transformed difference.
Example application
Compare a biomarker correlation in two independently sampled populations.
Interpretation and pitfalls
Watch out
Correlations sharing participants are dependent and need entries 82–83 or another dependent correlation method.
What changed in edition 2
- New sections: structure of the method, estimated and nuisance parameters, settings and design choices, fitting and adaptation, sensitivity and robustness.
Python and R
Independent correlation estimates; not appropriate for correlations sharing participants.
Validated — Executed successfully in the validation environment · needs numpy, scipy
import numpy as np
from scipy import stats
rng = np.random.default_rng(2026)
z=(np.arctanh(.5)-np.arctanh(.2))/np.sqrt(1/77+1/97)
print(z,2*stats.norm.sf(abs(z)))
Output
2.270659798585518 0.023167580445411697
Validated — Executed successfully in the validation environment · needs Base/standard library
r1<-.5;r2<-.2;n1<-80;n2<-100
z<-(atanh(r1)-atanh(r2))/sqrt(1/(n1-3)+1/(n2-3));print(c(z=z,p=2*pnorm(-abs(z))))
Output
z p 2.27065980 0.02316758
Sources
- cocor — cocor · cocor.indep.groupsAuthor documentation/source reviewed: cocor 1.1-4.search.r-project.org
- cocor.indep.groupssearch.r-project.org
- Statistics guide v4 (historical):
- R: Executed successfully in the validation environment
- Reference's record:
- Edition 2 review: Python: executed · R: not executed (Rscript unavailable). Python: Ran in the reference's review, on this exact code. R: Reviewed but not run: R wasn't available to the reference's authors.
From the CodeSplash statistics guide (v4), entry 081, updated from the reference's edition 2 (reviewed 14 November 2026) as STAT081.