Stats for

Correlation and Association

Comparing Correlation Coefficients

Comparing correlation coefficients tests whether the strength or direction of a relationship differs between two independent groups.

Comparing correlation coefficients takes the same two variables measured in two independent groups and tests whether their correlations differ in strength or direction.

Example

Is sleep more closely tied to mood for shift workers than for undergraduates? Eighty shift workers and 100 undergraduates logged their sleep and rated their mood every day for two weeks. We correlated average sleep with average mood in each group and compared the two correlations.

Two Independent Groups + 2 Continuous Variables → Comparing Correlation Coefficients
Tests
Difference between two population correlations
Observations
Independent
Parametric
Yes
Headline Statistic
z
Effect Size
Cohen's q
Groups
2

The Basics

When to Use It

Use it when you've measured the same two continuous variables in two separate groups of people and want to know whether the relationship between them differs in strength or direction from one group to the other. Each person belongs to one group only. With three or more groups, test all the correlations at once (a χ² test of whether the groups' Fisher z values are equal) or use a group × predictor interaction in a regression, rather than running every pair. For example:

  • Is sleep more closely tied to mood for shift workers than for undergraduates?
  • Is the correlation between screen time and depression symptoms stronger in girls than in boys?
  • Does a working-memory test predict reading scores as well in bilingual children as in monolingual children?

If both correlations come from the same people, such as sleep with mood and sleep with anxiety in one sample, the correlations are dependent correlations and need a different test (see Follow-Up Tests below).

Vocabulary You Need

Definition Fisher's z (z_r)

A stretched version of r, z_r = ½ ln[(1 + r) / (1 − r)]. A sample r can't go past ±1, so its sampling distribution gets lopsided near the edges; on the z scale it's roughly normal with standard error 1 / √(n − 3), as long as the data are roughly bivariate normal. Used to build confidence intervals for correlations and to compare them. Glossary →

Definition Cohen's q (q)

The effect size for comparing two correlations: q = z₁ − z₂, where each z is a correlation converted with Fisher's transformation. On that scale a gap is about equally easy to detect whether the correlations are small or large; like any unit-free effect size, it still depends on the design, the sample and how reliably things were measured. It has no upper limit and is close to r₁ − r₂ when both correlations are small. Glossary →

Definition Dependent Correlations

Two correlations that come from the same sample, such as sleep with mood and sleep with anxiety in one group of people. They share people, and often a variable, so they rise and fall together from sample to sample. Comparing them needs a test that also uses the correlations among the variables that aren't being compared (Steiger's or Meng's z, Williams's t); the independent-groups test would get the standard error wrong. Glossary →

Assumptions and Inference

1. Linear Relationship in Each Group (for What Each r Means) Each r measures a straight-line relationship; it can be computed for a curve, but then the two r's may not describe the same kind of relationship.
What It Means
As one variable goes up, the other tends to change by about the same amount across its whole range. A curved relationship, one that levels off or a U shape, breaks this.
Applies To
Relationship
How to Check
Look at a scatterplot of the two variables in each group separately: a roughly oval cloud tilted one way is fine; a clear bend, a ceiling or a U is not.
How Much It Matters
A lot, for what the comparison means. Each r only measures the straight-line part of its relationship, so if one group's relationship curves, the two rs aren't measuring the same thing. Check a scatterplot for each group separately.

What to Do

  • Proceed with Caveat If one group's relationship bends, show both scatterplots and describe the shapes rather than comparing two rs.
  • Transformation Transform a variable whose relationship levels off in both groups, then compare the correlations on that scale and say so.
2. Comparable Score Ranges (for Interpretation) The test can compare groups with different score ranges, but a narrower range in one group can weaken its correlation, so check the spreads before reading a difference as a different relationship.
What It Means
A correlation depends on how widely scores spread, not just on how the variables are linked. If one group covers a narrow slice of the scale (only good sleepers, say), its correlation will be weaker even if the underlying relationship is identical. The test is still valid for the correlations as they are; the difference just may reflect spread rather than relationship.
Applies To
Variances
How to Check
Compare each group's standard deviations and ranges on both variables, and look at the scatterplots side by side. Ask whether either group was selected in a way that cut off part of the range.
How Much It Matters
It doesn't stop the test, but it can decide what the difference means. A group whose scores cover a narrower range usually shows a weaker correlation even if the underlying relationship is the same, so a difference can reflect the groups' spreads rather than a different relationship. Our shift workers' sleep varies slightly more (SD 1.10 hours vs 1.00), not enough to explain a jump from .15 to .45, but worth reporting.

What to Do

  • Alternative Test Multiple Linear Regression. Test the group × predictor interaction in a regression, which compares how much the outcome differs, on average, per unit difference in the predictor rather than the strength of the correlation.
  • Proceed with Caveat Give each group's standard deviations beside its correlation, so readers can judge whether range restriction explains the difference.
3. No Extreme Outliers No single case is far enough from the rest to drive the result.
What It Means
A few points far from the rest can pull a statistic around on their own, so it describes those few points more than everyone else. In a test, that can create an effect that isn't there or hide one that is.
Applies To
Observations
How to Check
Plot the data and look for points far from the rest. With two or more variables, flag cases with large squared Mahalanobis distances across them: points can be ordinary on each variable but unusual in combination. Check each against the raw records, and compare the result with and without it.
How Much It Matters
A lot, especially in the smaller group. One point far from both means can pull a single r a long way, and the comparison inherits every bit of that. In our data no one is more than 2.7 standard deviations from their group's mean on either variable.

What to Do

  • Correction Check each extreme point against the raw data, and fix or remove data-entry errors.
  • Proceed with Caveat If the outlier is a real person, report the comparison with and without them.
4. Independent Observations (for the p-Value and Interval) The people (or other units) in your study don't influence each other.
What It Means
Each person's data comes from a separate, unconnected source, so knowing one person's scores tells you nothing about anyone else's. In designs that measure people more than once, their own scores are meant to be related; it's different people who must be independent. Methods built for clustered data, such as multilevel models and GEE, also allow members of the same group to be related, as long as the analysis names the grouping; then it's the groups that must be independent.
Applies To
Observations
How to Check
By design, not by a test. Did each person contribute their own data, with no clusters such as roommates, couples, therapy groups or classrooms whose members influence each other? If there are clusters, does the analysis model every one of them?
How Much It Matters
A lot. The test assumes the two correlations come from different, unrelated people, and that people within each group are independent too. If the same people supply both correlations, the standard error is wrong; that's a dependent-correlations design with its own tests. Our students and shift workers are separate samples.

What to Do

  • Alternative Test If both correlations come from the same people, use a test built for that, such as Steiger's (1980) z or Meng, Rosenthal and Rubin's (1992) z, which account for how the correlations are related (see Follow-Up Tests below).
  • Design Change Recruit each group separately, with one pair of scores per person.
5. Bivariate Normality (for the p-Value and Interval) The pairs of scores form an oval cloud, with each variable roughly bell-shaped.
What It Means
Each variable is roughly normal and the scatterplot forms an oval cloud; two bell-shaped variables alone don't guarantee it. The test's standard error, 1 / √(n − 3), comes from this shape, so the p-value and the interval rely on it. When the correlations aren't zero, skewed or heavy-tailed data can make the p-value too small and the interval too narrow, and a larger sample doesn't fix it.
Applies To
Joint distribution
How to Check
Look at a histogram of each variable and at the scatterplot in each group for strong skew, heavy tails or a funnel shape. Skewness beyond ±1 or kurtosis of 2 or more in either group is a warning sign (Bishara & Hittner, 2017). Don't rely on a normality test: with small samples it misses real problems, and with large ones it flags trivial ones.
How Much It Matters
More than for a single Pearson test against zero, and a bigger sample doesn't help. In a simulation we ran for this page, with a true correlation of .5 in both groups and strongly skewed scores, this test called the difference significant about one time in five instead of one in twenty, and no less often with 1,000 people per group than with 100. Fisher-z intervals can likewise miss far more often than 5% of the time, sometimes worse in bigger samples (Bishara & Hittner, 2017). In our data both variables are close to symmetric in both groups (all skewness within ±0.3, all kurtosis below 0).

What to Do

  • Alternative Test Spearman Correlation. If the variables are ordinal, heavily skewed, or better described by a one-direction trend than a straight line, compare Spearman correlations instead; the question becomes whether that trend differs. Don't simply apply this page's formula to ranks: ties, sample size and the shape of the data matter. One approximate approach compares the two Fisher-transformed Spearman correlations using Bonett and Wright's (2000) larger variance, (1 + ρ²/2)/(n − 3), for each group, and builds Zou's interval from the two Spearman intervals. Bishara and Hittner (2017) found single Spearman intervals held up to nonnormality, but that doesn't establish how this two-group comparison performs; a bootstrap of the difference is an alternative.
  • Transformation Transform strongly skewed variables toward a normal shape within each group before correlating, preferably with a rank-based inverse normal (RIN) transformation, which turns ranks into normal scores. RIN intervals held up to nonnormality in Bishara and Hittner's (2017) simulations. The comparison then describes the transformed scores.
  • Robust Estimation Resample each group separately, recompute r₁ − r₂ thousands of times, and use the middle 95% as the interval. An option, but in Bishara and Hittner's (2017) simulations bootstrap intervals for a correlation didn't fully fix coverage under nonnormality, so prefer the two remedies above.

Limitations

This Is Not Your Test If…

What It Doesn't Tell You

  • Why. Shift work wasn't assigned, so the groups differ in age, jobs, schedules and much else. The data can't say whether shift work itself makes mood hinge more on sleep.
  • Whether it matters. A significant difference doesn't make it large or useful: the interval runs from a very small difference (0.03) to a big one (0.55), in correlation units.
  • Whether the measures work equally well in both groups. A less reliable measure gives a weaker correlation. If the mood ratings were noisier for undergraduates, or meant something different to them, their r would be smaller for that reason alone. Report each group's reliability (such as Cronbach's α) next to its r.
  • Who else. The result describes shift workers and undergraduates like these, over the ranges of sleep they reported. Groups with narrower or wider ranges could show different correlations for that reason alone.
  • That the correlations are equal, if p had been above .05. With 80 and 100 people, a real difference of q = 0.30 (a medium one by convention) would be missed about half the time; smaller differences, more often. A non-significant result would have meant the data were inconclusive, not that the relationship is the same in both groups.

Common Mistakes

  • Don'tConclude the relationship differs because it was significant in one group and not the other.

    InsteadTest the difference between the correlations directly. One p below .05 and one above says nothing about the gap between them.

  • Don'tUse this test for two correlations measured on the same people.

    InsteadUse a dependent-correlations test (Steiger's or Meng's z), which accounts for the overlap.

  • Don'tSubtract the two r values and test the gap with a t-test.

    InsteadConvert each r to Fisher's z first. For roughly bivariate-normal data, its standard error is nearly the same at every level of r; r's isn't.

  • Don'tRead a bigger correlation in one group as a bigger effect of one variable on the other.

    InsteadRemember correlations depend on each group's spread. Compare slopes too if you care about how much the outcome differs per unit of the predictor.

  • Don'tSwitch to a one-sided p because the result went the way you hoped.

    InsteadUse a one-sided test only if you predicted which group would show the stronger correlation before collecting data, and say so.

  • Don'tRead a p-value as the chance that the null hypothesis is true.

    InsteadRead it as: if the null were true, how often data at least this extreme would turn up.

Result Decoder

Significance and Effect Size Guidelines

Benchmarks Significance (p Value)
  • p < .001

    Very strong evidence against the null hypothesis.

  • .001 ≤ p < .01

    Strong evidence against the null hypothesis.

  • .01 ≤ p < .05

    Statistically significant at α = .05. Moderate evidence against the null hypothesis.

  • .05 ≤ p < .10

    Not significant. Weak evidence; sometimes called a “trend.” Treat it as inconclusive.

  • p ≥ .10

    Not significant. Little evidence against the null, which is not the same as evidence of no effect.

These evidence labels are one common convention for describing p in graded language rather than as significant or not; the boundaries are rough guides, not rules, and other authors draw them differently. Muff et al. (2022) argue for this kind of language of evidence over a single cutoff. α is chosen before the analysis, and p never says how big or important an effect is.

More about statistical significance ↓

Benchmarks Effect Size (Cohen's q)
  • |q| < 0.10 Below Small

    Smaller than the conventional small benchmark. Whether an effect this size matters depends on the setting.

  • 0.10 ≤ |q| < 0.30 Small

    A modest difference between the two correlations.

  • 0.30 ≤ |q| < 0.50 Medium

    A moderate difference in the strength or direction of the two straight-line relationships, such as .20 vs .47.

  • |q| ≥ 0.50 Large

    A substantial difference on Fisher's transformed correlation scale.

The sign shows which correlation is larger; the benchmarks apply to its size. They are Cohen's (1988, 1992) conventions, chosen to parallel r's .10, .30 and .50, not measures of practical importance.

More about effect size ↓

How It's Reported

Equation Form

Example

r1 − r2 = 0.30, 95% CI [0.03, 0.55], q = 0.33, z = 2.18, p = .029

Table 1. Sleep, Mood and Their Correlation in Each Group

Example
nSleep MSleep SDMood MMood SDr95% CIpz_r
Shift workers 806.001.106.001.50.45[.25, .61]< .0010.484
Undergraduates 1007.001.006.501.50.15[−.05, .34].1360.151

Note. Sleep is average hours per night; mood is the average daily rating (1–10). The 95% CI for each r comes from Fisher's z; p tests each r against zero. zr is each r on Fisher's z scale, which the comparison uses.

Full Text (APA Style)

Example

Shift workers slept less than undergraduates (M = 6.00 hours, SD = 1.10, vs M = 7.00, SD = 1.00) and reported slightly lower mood (M = 6.00, SD = 1.50, vs M = 6.50, SD = 1.50). Among shift workers, those who slept more tended to report better mood, r(78) = .45, 95% CI [.25, .61]; among undergraduates the correlation was weaker, r(98) = .15, 95% CI [−.05, .34]. The shift workers' correlation was 0.30 higher, 95% CI [0.03, 0.55] (Zou's method), a medium difference by convention, q = 0.33. A Fisher z test showed the difference was statistically significant, z = 2.18, p = .029.

  • Report each group's r, n and interval before the comparison, so readers can see what's being compared.
  • Give the difference and its interval, not just z and p. Say which method built the interval.
  • Don't report the two p-values against zero as if they were the comparison. The z test of the difference is the result.
  • Give each group's SDs: a difference in correlations can come from a difference in spread.

Reading Each Piece

The equation form above, piece by piece, in this order: how big, how certain, then how surprising.

r1 − r2 = 0.30 The sleep–mood correlation is 0.30 higher among shift workers (.45) than among undergraduates (.15).
q = 0.33 On Fisher's scale the correlations are 0.33 apart, just past the conventional medium benchmark of 0.30. Whether that matters is a question about sleep and shift work: it says sleep is a noticeably better guide to a shift worker's mood. Benchmarks ↑
95% CI [0.03, 0.55] The true gap between the two correlations is plausibly anywhere from a very small difference (0.03) to a big one (0.55), in correlation units. The whole range is above zero, but these sample sizes pin it down only roughly.
z = 2.18 The two correlations are 2.18 standard errors apart on Fisher's scale. Beyond about ±1.96 counts as significant at .05.
p = .029 If the sleep–mood correlation were the same in both populations, samples of these sizes would give correlations at least this far apart, in either direction, about 3% of the time. That's below .05, so the difference is statistically significant. Benchmarks ↑

Calculations

The Running Example

Example

The shift-work study: 80 shift workers and 100 undergraduates, each with two weeks' average sleep and mood, asking whether the sleep–mood correlation differs between the groups.

Null Hypothesis:
\rho_1 = \rho_2
Alternative (Two-Sided):
\rho_1 \neq \rho_2

\rho_1 (“rho one”) is the population correlation between sleep and mood among shift workers, and \rho_2 the same correlation among undergraduates. Our samples' r₁ = .45 and r₂ = .15 estimate them. Group 1 is the shift workers, so every difference is shift workers minus undergraduates.

What Your Data Should Look Like

One row per person, one numeric column for each of the two variables, and a column saying which group the person belongs to. Each group's correlation is computed from its own rows only. If you only have published results, the two rs and the two sample sizes are all the test needs.

Example
participantsamplesleep_hoursmood
1shift_worker5.26.0
2shift_worker5.93.5
3shift_worker6.15.7
4shift_worker5.25.8
5shift_worker6.66.1
6shift_worker4.34.4
… 174 more rows
nSleep Hours M (SD)Mood M (SD)r
Shift workers806.00 (1.10)6.00 (1.50).45
Undergraduates1007.00 (1.00)6.50 (1.50).15

Simulated data.

Download all 180 rows (data.csv)

Napkin Math

The whole test, one idea at a time. Under each heading, a line says why the step matters, and the green note reads the equation in plain English with the shift-work study's numbers. Collapse all to read just the headings: they tell the whole story on their own.

  1. 1. Measure the Relationship in Each Group

    Everything starts with two ordinary Pearson correlations, one per group, each computed only from that group's people.

    r = \dfrac{\text{cov}_{xy}}{s_x \, s_y}

    r_1 = 0.45

    r_2 = 0.15

    The same formula, run once per group. For the 80 shift workers, r_1 = .45: more sleep goes fairly clearly with better mood. For the 100 undergraduates, r_2 = .15: a much weaker trend.

  2. 2. Find the Gap between the Two Correlations

    The plainest answer to “how much stronger?” is one correlation minus the other. It's what readers will picture, so it's what we report.

    r_1 - r_2 =.45 - .15

    = 0.30

    r_1 is the shift workers' .45 and r_2 the undergraduates' .15. .45 − .15 = 0.30: the relationship is 0.30 stronger among shift workers. The difference can run from −2 to 2, so unlike *r* it keeps its leading zero.

  3. 3. Stretch Both Correlations onto a Scale Where Uncertainty Is Even

    A correlation can't pass 1, so near the edges its chance variation gets squashed, and a gap of .30 means different things at different heights. Fisher's transformation stretches the scale so every correlation has the same kind of uncertainty, as long as the data are roughly bivariate normal.

    z_r = \tfrac{1}{2}\ln\!\left(\dfrac{1 + r}{1 - r}\right) =z_1 = \tfrac{1}{2}\ln\!\left(\tfrac{1.45}{0.55}\right),\;\; z_2 = \tfrac{1}{2}\ln\!\left(\tfrac{1.15}{0.85}\right)

    z_1 = 0.484

    z_2 = 0.151

    \ln is the natural log. For shift workers, 1.45 ÷ 0.55 = 2.64, its log is 0.97, and half is 0.48. For undergraduates, 1.15 ÷ 0.85 = 1.35, its log is 0.30, and half is 0.15. Small correlations barely change; bigger ones stretch more. Careful: these z_1 and z_2 (Fisher's z_r for each group) are correlations on the stretched scale, not test statistics. The test's own z comes in step 6.

  4. 4. Measure How Big the Difference Is on That Scale

    The gap on the stretched scale is Cohen's q. Fisher's transformation makes the sampling uncertainty more nearly constant across correlation values under the usual assumptions, so q expresses the gap on a scale where differences are easier to compare statistically.

    q = z_1 - z_2 =0.484 - 0.151

    = 0.33

    z_1 is the shift workers' 0.484 and z_2 the undergraduates' 0.151. 0.484 − 0.151 = 0.33.

  5. 5. Figure Out How Precisely We Know the Difference

    Each group's Fisher's z wobbles from sample to sample. For roughly normal data its variance (its standard error squared) is 1 / (n − 3), which depends only on the group's size. Variances of independent estimates add, so we add the two variances, not the two standard errors, and take the square root.

    SE = \sqrt{\dfrac{1}{n_1 - 3} + \dfrac{1}{n_2 - 3}} =\sqrt{\dfrac{1}{80 - 3} + \dfrac{1}{100 - 3}}

    = 0.153

    n_1 is our 80 shift workers and n_2 our 100 undergraduates. 1 ÷ 77 = 0.0130 and 1 ÷ 97 = 0.0103; added, 0.0233, and its square root is 0.153.

  6. 6. Compare the Difference with That Uncertainty

    A gap only means something relative to how much it could wobble by chance. The test statistic z counts how many standard errors apart the two correlations are. It's a different thing from z_1 and z_2, the transformed correlations from step 3.

    z = \dfrac{z_1 - z_2}{\sqrt{\dfrac{1}{n_1 - 3} + \dfrac{1}{n_2 - 3}}} =\dfrac{0.333}{0.153}

    = 2.18

    The 0.333 gap between z_1 and z_2, divided by its 0.153 standard error, is 2.18: the correlations sit 2.18 standard errors apart.

  7. 7. Give a Range of Plausible Values for the True Difference

    Each correlation already has its own lopsided interval. Zou's method combines them, pairing how far one could fall with how far the other could rise, so the range for the difference stays lopsided the way correlations are.

    \left[\, (r_1 - r_2) - \sqrt{(r_1 - l_1)^2 + (u_2 - r_2)^2},\;\; (r_1 - r_2) + \sqrt{(u_1 - r_1)^2 + (r_2 - l_2)^2} \,\right] =\left[\, 0.30 - \sqrt{0.195^2 + 0.187^2},\;\; 0.30 + \sqrt{0.160^2 + 0.198^2} \,\right]

    = [0.03, 0.55]

    First, each *r* gets its own 95% interval: on Fisher's scale it's z_r ± 1.96 / √(n − 3), and each end is turned back into a correlation with r = (e^{2z_r} - 1)/(e^{2z_r} + 1). For shift workers, 0.484 ± 1.96 / √77 = 0.484 ± 0.223, or 0.261 to 0.707, which is .25 to .61 as correlations. For undergraduates, 0.151 ± 1.96 / √97 = 0.151 ± 0.199, or −0.048 to 0.350, which is −.05 to .34. Now combine them. For the low end: .45 could fall 0.195 and .15 could rise 0.187; √(0.195² + 0.187²) = 0.27, and 0.30 − 0.27 = 0.03. For the high end: .45 could rise 0.160 and .15 could fall 0.198; √(0.160² + 0.198²) = 0.25, and 0.30 + 0.25 = 0.55.

  8. 8. Ask How Surprising the Result Would Be If the Correlations Were Really Equal

    Finally, ask how often two correlations at least this far apart would turn up if sleep and mood were equally closely tied in both populations.

    p = 2 \times P(Z \ge |z|) =2 \times P(Z \ge 2.18)

    = .029

    P(Z \ge 2.18) is the chance a standard normal value lands at or above 2.18, about .015. Doubling it counts both directions: .029, about 1 in 34.

Run It in Software

The code below reads the running example's data from data.csv; save it in the same folder you run the code from.

SPSS (version 30, as documented by IBM)

SPSS has no menu for comparing correlations from two groups, so it's two steps: get each group's r, then compute the test with a few lines of syntax.

  1. Data → Split File. Choose Compare groups, move sample into Groups Based on, and click OK.
  2. Analyze → Correlate → Bivariate. Move sleep_hours and mood into Variables, leave Pearson checked, ask for a 95% confidence interval, and click OK.
  3. Note each group's r and N, then turn Split File off (Data → Split File → Analyze all cases).
  4. Paste the second block of syntax below into a syntax window, type in the two rs and Ns, and run it. It creates a new one-row dataset and lists the results; its first line names your open data (rawdata) so SPSS keeps it open rather than replacing it.

Or paste this syntax:

SORT CASES BY sample.
SPLIT FILE LAYERED BY sample.
CORRELATIONS
  /VARIABLES=sleep_hours mood
  /PRINT=TWOTAIL NOSIG FULL
  /CI CILEVEL(95)
  /MISSING=PAIRWISE.
SPLIT FILE OFF.

* Fisher z test and Zou (2007) interval for two independent correlations.
* Naming the open data first keeps it open: DATA LIST then starts a new dataset.
* If you already have a dataset called rawdata open, pick another name here.
DATASET NAME rawdata.
* Replace the four numbers below with your own r1 n1 r2 n2.
DATA LIST FREE / r1 n1 r2 n2.
BEGIN DATA
.4494618 80 .1501825 100
END DATA.
COMPUTE z1 = 0.5 * LN((1 + r1) / (1 - r1)).
COMPUTE z2 = 0.5 * LN((1 + r2) / (1 - r2)).
COMPUTE q = z1 - z2.
COMPUTE se = SQRT(1 / (n1 - 3) + 1 / (n2 - 3)).
COMPUTE z = q / se.
COMPUTE p = 2 * (1 - CDF.NORMAL(ABS(z), 0, 1)).
COMPUTE h1 = IDF.NORMAL(0.975, 0, 1) / SQRT(n1 - 3).
COMPUTE h2 = IDF.NORMAL(0.975, 0, 1) / SQRT(n2 - 3).
COMPUTE l1 = (EXP(2 * (z1 - h1)) - 1) / (EXP(2 * (z1 - h1)) + 1).
COMPUTE u1 = (EXP(2 * (z1 + h1)) - 1) / (EXP(2 * (z1 + h1)) + 1).
COMPUTE l2 = (EXP(2 * (z2 - h2)) - 1) / (EXP(2 * (z2 - h2)) + 1).
COMPUTE u2 = (EXP(2 * (z2 + h2)) - 1) / (EXP(2 * (z2 + h2)) + 1).
COMPUTE diff = r1 - r2.
COMPUTE ci_low = diff - SQRT((r1 - l1)**2 + (u2 - r2)**2).
COMPUTE ci_high = diff + SQRT((u1 - r1)**2 + (r2 - l2)**2).
FORMATS diff q se z p ci_low ci_high (F8.4).
LIST diff ci_low ci_high q z p.

Reading the Output

The split-file correlations give each group's r, its interval and its test against zero. Read them as the inputs, not the answer.

Correlations (the off-diagonal cell for each group)

sample Pearson Correlation Sig. (2-tailed) N 95% CI Lower Upper
shift_worker .449** .000 80 .255 .609
student .150 .136 100 -.048 .337

One group is significant and the other isn't, but that isn't the comparison. The syntax block is:

diff ci_low ci_high q z p
.2993 .0298 .5534 .3327 2.1798 .0293

Read it in this order: the difference (diff), its interval (ci_low, ci_high), Cohen's q, then z and p.

Output laid out from this page's computed results, not captured from a live run; labels and layout may differ slightly in your version.

R
# install.packages("cocor")
library(cocor)

shift <- read.csv("data.csv")
sw <- subset(shift, sample == "shift_worker")
ug <- subset(shift, sample == "student")

cocor.indep.groups(
  r1.jk = cor(sw$sleep_hours, sw$mood), n1 = nrow(sw),
  r2.hm = cor(ug$sleep_hours, ug$mood), n2 = nrow(ug)
)
  Results of a comparison of two correlations based on independent groups

Comparison between r1.jk = 0.4495 and r2.hm = 0.1502
Difference: r1.jk - r2.hm = 0.2993
Group sizes: n1 = 80, n2 = 100
Null hypothesis: r1.jk is equal to r2.hm
Alternative hypothesis: r1.jk is not equal to r2.hm (two-sided)
Alpha: 0.05

fisher1925: Fisher's z (1925)
  z = 2.1798, p-value = 0.0293
  Null hypothesis rejected

zou2007: Zou's (2007) confidence interval
  95% confidence interval for r1.jk - r2.hm: 0.0298 0.5534
  Null hypothesis rejected (Interval does not include 0)

The cocor package (Diedenhofen & Musch, 2015) runs both the Fisher z test and Zou's interval by default. Cohen's q isn't printed: it's atanh(r1) - atanh(r2), 0.3327.

Output from a real run: R 4.6.1 (cocor 1.1-4), run 2026-10-03.

Python
import numpy as np
import pandas as pd
from scipy import stats

shift = pd.read_csv("data.csv")

def summarize(g):
    res = stats.pearsonr(g["sleep_hours"], g["mood"])
    ci = res.confidence_interval(0.95)   # Fisher z interval
    return res.statistic, len(g), ci.low, ci.high

r1, n1, l1, u1 = summarize(shift[shift["sample"] == "shift_worker"])
r2, n2, l2, u2 = summarize(shift[shift["sample"] == "student"])

q = np.arctanh(r1) - np.arctanh(r2)          # Cohen's q
se = np.sqrt(1 / (n1 - 3) + 1 / (n2 - 3))
z = q / se
p = 2 * stats.norm.sf(abs(z))

d = r1 - r2                                   # Zou (2007) interval
ci = (d - np.sqrt((r1 - l1)**2 + (u2 - r2)**2),
      d + np.sqrt((u1 - r1)**2 + (r2 - l2)**2))

print(f"r1 = {r1:.4f}, r2 = {r2:.4f}, difference = {d:.4f}")
print(f"q = {q:.4f}, z = {z:.4f}, p = {p:.4f}")
print(f"95% CI for rho1 - rho2: [{ci[0]:.4f}, {ci[1]:.4f}]")
r1 = 0.4495, r2 = 0.1502, difference = 0.2993
q = 0.3327, z = 2.1798, p = 0.0293
95% CI for rho1 - rho2: [0.0298, 0.5534]

scipy has no function for comparing two correlations, so the test is written out; pearsonr supplies each r and its Fisher interval.

Output from a real run: Python 3.9.6 (scipy 1.12.0, pandas 2.3.3), run 2026-10-03.

Impact

Effect Size

Cohen's q is the difference between the two correlations after each is converted to Fisher's z. On that scale the sampling uncertainty is more nearly constant across correlation values (under the usual assumptions), which makes gaps easier to compare statistically; it doesn't make every q equally meaningful in practice. The plain difference, r₁ − r₂, is easier to picture, so report both.

q = z_1 - z_2 = 0.484 - 0.151 = 0.33 \qquad r_1 - r_2 = .45 - .15 = 0.30

Sleep went with mood noticeably more closely among shift workers than among undergraduates: 0.33 apart on Fisher's scale, just past the conventional medium benchmark of 0.30, and 0.30 apart as plain correlations.

With correlations this far from ±1, q and r₁ − r₂ are almost the same; they part ways when either correlation is near the edge. Benchmarks are conventions. In the study's own terms, knowing how a shift worker slept tells you a fair amount about their mood (sleep goes with about 20% of the variation in mood, r² = .20), while for undergraduates it tells you very little (about 2%).

Benchmarks Cohen's q at a Glance
Below Small
|q| < 0.10
Small
0.10 ≤ |q| < 0.30
Medium
0.30 ≤ |q| < 0.50
Large
|q| ≥ 0.50

Full benchmarks and caveats ↑

Statistical Significance

p answers one narrow question: if the two populations had exactly the same correlation, how often would samples of these sizes give correlations at least this far apart, in either direction? Below the conventional α = .05, the difference is called statistically significant.

If sleep and mood were equally closely tied for shift workers and undergraduates, samples of 80 and 100 would show correlations at least this far apart, in either direction, about 2.9% of the time, roughly 1 in 34. That's below .05, so the difference is significant.

Notice what p is not here: it isn't the pair of p-values from testing each correlation against zero. The shift workers' r was significant (p < .001) and the undergraduates' wasn't (p = .136), but that contrast is not a test of anything (Gelman & Stern, 2006). Had the shift workers' correlation been .30 instead, it would still have been significant on its own (p = .007), yet the two correlations wouldn't have differed significantly (z = 1.04, p = .30). p is also not the probability that the correlations are equal, and it says nothing about how big the difference is. That's what q and the interval are for.

Benchmarks p at a Glance
Very Strong
p < .001
Strong
.001 ≤ p < .01
Significant
.01 ≤ p < .05
Weak
.05 ≤ p < .10
Little
p ≥ .10

Strength of evidence against the null hypothesis.

Full benchmarks and caveats ↑

Power and Sample Size

Power is the chance that a study detects an effect that's really there. Comparing correlations takes far more people than testing one: each group's correlation carries its own uncertainty, and the difference inherits both. Power depends on how far apart the true correlations are (Cohen's q), how many people are in each group, α, and whether the test is one- or two-sided.

Suppose, before collecting any data, we expected the correlations to differ by a medium amount, q = 0.30. With 80 shift workers and 100 undergraduates, the study would come out significant only about half the time (50%). Our result was significant, but a study this size would miss a real difference like it about as often as it finds one. Keeping the same 4-to-5 split, 80% power would take 160 shift workers and 200 undergraduates.

The calculator works as G*Power's “z test: Correlation – inequality of two independent Pearson r's” does: the difference between the two Fisher z values, divided by its standard error, is compared with the normal distribution. Equal groups are the most efficient: for the same total, a lopsided split gives less power.

Researchers usually aim for at least 80% power. Plan it before collecting data, using the smallest difference that would matter. For a medium difference (q = 0.30) at α = .05, that takes 178 people in each group, 356 in all (Cohen's 1992 table lists 177 per group); for a small one (q = 0.10), about 1,570 in each. That's more than four times the 85 people needed to detect a single correlation of .30. Try it:

Other Info

Follow-Up and Post Hoc Tests

Planned Contrasts

  • Tests for Dependent Correlations: Use when both correlations come from the same people, instead of this test. If we'd also measured anxiety in the shift workers, comparing sleep–mood with sleep–anxiety in that one sample would need a test such as Steiger's (1980) z, Meng, Rosenthal and Rubin's (1992) z or Williams's t, all of which use the correlation between mood and anxiety too. In Hittner, May and Silver's (2003) simulations, Williams's t and Dunn and Clark's z performed best overall. Zou's (2007) interval has versions for these designs as well.

References

  • Fisher, R. A. (1921). On the “probable error” of a coefficient of correlation deduced from a small sample. Metron, 1, 3–32. https://digital.library.adelaide.edu.au/server/api/core/bitstreams/d40cfd09-0ddc-490a-89c1-437bf6ae26ef/content
    “by a simple transformation, a variable might be obtained the sampling curves of which are practically normal and of constant standard deviation” (p. 4)
  • Fisher, R. A. (1925). Statistical methods for research workers. Oliver and Boyd.
    “In this case we require not only the difference of the values of z, but the standard error of the difference.” (Ch. VI, §35, Ex. 32, p. 168)
  • Zou, G. Y. (2007). Toward using confidence intervals to compare correlations. Psychological Methods, 12(4), 399–413. https://doi.org/10.1037/1082-989X.12.4.399
    “The distinctive feature of this approach is its acknowledgment of the asymmetry of sampling distributions for single correlations.” (Abstract)
  • Gelman, A., & Stern, H. (2006). The difference between “significant” and “not significant” is not itself statistically significant. The American Statistician, 60(4), 328–331. https://doi.org/10.1198/000313006X152649
    “In making a comparison between two treatments, one should look at the statistical significance of the difference rather than the difference between their significance levels.” (p. 329)
  • Diedenhofen, B., & Musch, J. (2015). cocor: A comprehensive solution for the statistical comparison of correlations. PLOS ONE, 10(4), e0121945. https://doi.org/10.1371/journal.pone.0121945
  • G*Power 3.1 manual. (2023, June 1). Heinrich-Heine-Universität Düsseldorf. https://www.psychologie.hhu.de/fileadmin/redaktion/Fakultaeten/Mathematisch-Naturwissenschaftliche_Fakultaet/Psychologie/AAP/gpower/GPowerManual.pdf
    “the H1-distribution is normal distribution N (q/s, 1)” (§27.5, z test: Correlation – inequality of two independent Pearson r's)
  • Bonett, D. G., & Wright, T. A. (2000). Sample size requirements for estimating Pearson, Kendall and Spearman correlations. Psychometrika, 65(1), 23–28. https://doi.org/10.1007/BF02294183
  • Bishara, A. J., & Hittner, J. B. (2017). Confidence intervals for correlations when data are not normal. Behavior Research Methods, 49(1), 294–309. https://doi.org/10.3758/s13428-016-0702-8
    “Nonnormality often distorted the Fisher z' confidence interval” (Abstract)
  • Cohen, J. (1992). A power primer. Psychological Bulletin, 112(1), 155–159. https://doi.org/10.1037/0033-2909.112.1.155
    “To detect a medium-sized difference between two population rs (q = .30 in Table 1) at α = .05 requires N = 177 in each group.” (p. 158)
  • Cohen, J. (1988). Statistical power analysis for the behavioral sciences (2nd ed.). Lawrence Erlbaum Associates.
  • Steiger, J. H. (1980). Tests for comparing elements of a correlation matrix. Psychological Bulletin, 87(2), 245–251. https://doi.org/10.1037/0033-2909.87.2.245
  • Meng, X.-L., Rosenthal, R., & Rubin, D. B. (1992). Comparing correlated correlation coefficients. Psychological Bulletin, 111(1), 172–175. https://doi.org/10.1037/0033-2909.111.1.172
  • Muff, S., Nilsen, E. B., O'Hara, R. B., & Nater, C. R. (2022). Rewriting results sections in the language of evidence. Trends in Ecology & Evolution, 37(3), 203–210. https://doi.org/10.1016/j.tree.2021.10.009
    “we suggest language of evidence that allows for a more nuanced approach to communicate scientific findings as a simple and intuitive alternative to statistical significance testing” (Abstract)
  • Bishara, A. J., & Hittner, J. B. (2012). Testing the significance of a correlation with nonnormal data: Comparison of Pearson, Spearman, transformation, and resampling approaches. Psychological Methods, 17(3), 399–417. https://doi.org/10.1037/a0028087
  • Hittner, J. B., May, K., & Silver, N. C. (2003). A Monte Carlo evaluation of tests for comparing dependent correlations. The Journal of General Psychology, 130(2), 149–168. https://doi.org/10.1080/00221300309601282
    “the findings suggested that O. J. Dunn and V. A. Clark's (1969) z and E. J. Williams's (1959) t have the best overall statistical properties” (Abstract)

Spot an error? Something still confusing? Tell us at support@statsforpsychology.com.