Business Analytics & Data Science

B05 · Intermediate

Correlation Analysis

10 lessons

B05 · Module 2, lesson 2 · Lesson 4 of 10

Testing a correlation

Decide whether a sample correlation is evidence of a real association, put a confidence interval round it with Fisher’s z, and plan how many pairs a study needs. Test rain against footfall at both cafés, see why r = 0.14 is significant with 612 pairs while r = 0.64 is not with 8, and compare the two cafés’ correlations without confusing significance with size.

About 85 minutes

Before you start

You will be able to

  • State the null and alternative hypotheses for a correlation, and calculate the t statistic r√(n − 2) ÷ √(1 − r²) and its p-value, one- or two-sided, by hand and in Excel.
  • Calculate the critical value of r for a given n and α, and explain why the same r can be significant with many pairs and not with few.
  • Construct a confidence interval for a population correlation with Fisher’s z transformation, using FISHER and FISHERINV.
  • Calculate the power of a correlation test and the number of pairs needed to detect a given correlation.
  • Compare correlations from two independent samples, and judge whether a significant correlation is large enough to matter.

Review first

  • Hypothesis testing — Null and alternative hypotheses, p-values, one- and two-sided tests, α, power and Type I and II errors are used here without re-teaching.
  • Confidence intervals — An interval as estimate ± critical value × standard error, and what 95% confidence means.
  • Rank correlation — Spearman’s ρ and Kendall’s τ-b, whose tests are mentioned here.
  • Covariance and Pearson’s r — Pearson’s r and r², the statistic this lesson tests.

Fictional case A fictional coffee business founded by Ana Lim. It starts as a catering and barista-training service, opens its own cafés and an online shop for beans, and plans a canned cold brew.

The idea

Fictional case

Ana suspects rain keeps customers away. At Harbourside, the waterfront café, the daily log for 1 March to 31 December 2027 gives a correlation of −0.23 between the day’s rain and the number of people through the door. At Millbrook, in the office district, the same 306 days give −0.10. Both are negative, both are small. Is either more than the scatter that 306 days of chance could produce if rain made no difference at all?

The question a test answers

Ana’s log is a sample: 306 days of one year, from all the days the cafés might trade under similar conditions. The correlation in that population is written ρ\rho (rho); the sample’s rr estimates it. Even if ρ\rho were exactly 0, a sample of days would almost never give r = 0 exactly: random variation pushes it a little above or below. The test asks whether Ana’s r is further from 0 than that variation would plausibly take it.

In the language of the hypothesis-testing lesson (B04):

H0:ρ=0H1:ρ≠0H_0: \rho = 0 \qquad H_1: \rho \ne 0

The null hypothesis says there is no linear association in the population; the two-sided alternative says there is one, in either direction. This is the test OpenStax’s statistics texts give for the “significance of the correlation coefficient”, and the one software reports beside r.

The t statistic

If H0H_0 is true and the conditions below hold, the statistic

t=rn−21−r2t = \dfrac{r\sqrt{n - 2}}{\sqrt{1 - r^2}}

follows the t distribution with n−2n - 2 degrees of freedom. As in fitting a straight line (B06), two quantities are estimated from the data, an intercept and a slope, and each costs a degree of freedom. For Harbourside, t=−0.2276×304÷1−0.22762=−4.08t = -0.2276 \times \sqrt{304} \div \sqrt{1 - 0.2276^2} = -4.08 with 304 degrees of freedom, and the two-sided p-value, =T.DIST.2T(ABS(-4.075),304), is below 0.001. If rain made no difference to Harbourside’s footfall, a correlation as far from 0 as −0.23 would turn up in fewer than 1 sample of 306 days in 1,000. Ana rejects H0H_0: rainier days go with fewer people at Harbourside.

At Millbrook, r = −0.102 gives t = −1.79 and a two-sided p-value of 0.074. At α = 0.05 Ana fails to reject H0H_0: the log is compatible with no linear association between rain and footfall at Millbrook, though, as B04 stressed, that is not evidence that there is none.

Why n matters so much

The formula rewards sample size. Turned round, it gives the smallest |r| that is significant for a given n, the critical value of r. At α = 0.05, two-sided, it is 0.707 for 8 pairs, 0.361 for 30, 0.197 for 100 and 0.079 for 612.

The critical value of |r| at α = 0.05 (two-sided) against the number of pairs, on a log scale. Correlations above the curve are significant. A: eight April days at Harbourside, r = 0.64 for temperature and footfall, below the curve. B: the 612 café-days, |r| = 0.14 for rain and footfall, above it.

Two consequences follow. With 612 café-days, rain’s pooled correlation with footfall, r = −0.14, is significant (p below 0.001, though the 612 rows hold only 306 weather days; see Conditions) although r² = 0.019: rain accounts for under 2% of the day-to-day variation in footfall. And eight days in April, 5–12 April at Harbourside, give r = 0.64 between the day’s high and footfall, which looks strong, but p = 0.088: with 8 pairs a correlation that size is well within what chance produces. A p-value answers “could this be chance?”, not “is this large?”.

In depth

Conditions

The t test of r rests on assumptions. OpenStax lists them in regression terms: a linear relationship; for each x, y values roughly normal around the line with the same spread; independent errors; and data from a random sample or a randomised experiment. In practice: plot the data first (a curve or a slip can make r, and its test, misleading), and ask whether the pairs are independent.

Independence is the condition most often broken by business data. Ana’s days come in sequence, and some of her columns follow the season: a warm day is usually followed by another warm day, and footfall at the waterfront rises and falls with the summer. At Harbourside the correlation between one day’s high and the next day’s is 0.93. Days that resemble their neighbours carry less independent information than their number suggests, so the test treats 306 days as more evidence than they are and its p-values come out too small; for temperature against footfall the effective number of days is far below 306. Rain, by contrast, is close to independent from one day to the next in this log (the same day-to-day correlation is −0.08), so its tests are less affected. Pooling the cafés adds a different problem: each day’s rain appears twice, once for each café, so the 612 rows hold only 306 different weather days. Treat a p-value from a time series as a rough guide, and be most cautious when it is near α or when both variables follow the season.

One-sided and two-sided tests

If the question, fixed before looking at the data, is whether rain goes with fewer customers, the alternative is one-sided, H1:ρ<0H_1: \rho < 0, and the p-value is the lower tail, =T.DIST(t,n-2,TRUE). For Millbrook that is 0.037, half the two-sided 0.074, and below 0.05. This is exactly the temptation the hypothesis-testing lesson warned about: switching to one-sided after seeing the two-sided p-value doubles the real false-alarm rate. Ana’s question when she started the log was “does rain make any difference?”, so she keeps the two-sided test.

Critical values of r

Solving t=rn−2/1−r2t = r\sqrt{n-2}/\sqrt{1-r^2} for r at the critical t gives the critical value of r directly:

rcrit=tcritn−2+tcrit2,tcrit=T.INV.2T(α, n−2)r_{\text{crit}} = \dfrac{t_{\text{crit}}}{\sqrt{n - 2 + t_{\text{crit}}^2}}, \qquad t_{\text{crit}} = \texttt{T.INV.2T}(\alpha,\, n-2)
Smallest |r| significant at α = 0.05, two-sided
Pairs (n)5810203050100306612
Critical |r|0.8780.7070.6320.4440.3610.2790.1970.1120.079

OpenStax’s Method 2 uses a printed table like this one instead of a p-value. The table makes the trade-off plain: with a handful of pairs only very strong correlations can be told apart from chance, and with hundreds almost any correlation can.

A confidence interval for ρ

A confidence interval says how large the population correlation plausibly is, which a p-value doesn’t. The sampling distribution of r is skewed when ρ\rho is far from 0 (r can’t go above 1), so the usual estimate ± margin doesn’t work. Fisher’s z transformation fixes this: z=atanh⁡(r)=12ln⁡1+r1−rz = \operatorname{atanh}(r) = \tfrac{1}{2}\ln\frac{1+r}{1-r} is close to normal with standard error 1/n−31/\sqrt{n-3}, whatever ρ\rho is. Build the interval for z, then transform its ends back with tanh⁡\tanh.

For Harbourside’s rain: z=atanh⁡(−0.2276)=−0.2316z = \operatorname{atanh}(-0.2276) = -0.2316, SE=1/303=0.0574SE = 1/\sqrt{303} = 0.0574, so the 95% interval for z is −0.2316±1.96×0.0574-0.2316 \pm 1.96 \times 0.0574, from −0.3442 to −0.1190. Back-transformed, the interval for ρ\rho runs from −0.331 to −0.118. In Excel: =FISHERINV(FISHER(B1)-NORM.S.INV(0.975)/SQRT(B2-3)) and =FISHERINV(FISHER(B1)+NORM.S.INV(0.975)/SQRT(B2-3)), with r in B1 and n in B2.

The interval is not symmetric about r: it stretches further on the side away from ±1. It also agrees with the test: it excludes 0, as a two-sided test at 5% that rejects ρ = 0 requires (approximately, since the test uses t and the interval Fisher’s z). Millbrook’s interval, −0.212 to 0.010, includes 0. For the eight April days it runs from −0.120 to 0.926: anything from a weak negative association to a near-perfect positive one. That width is the honest summary of what eight days can say.

Testing a value other than 0

Sometimes the question is not whether ρ\rho is 0 but whether it exceeds some value that matters, such as 0.3. The t test above works only for ρ0=0\rho_0 = 0; Fisher’s z handles any value: z=(atanh⁡r−atanh⁡ρ0)n−3z = (\operatorname{atanh} r - \operatorname{atanh}\rho_0)\sqrt{n-3}, compared with the standard normal. A hardware chain (fictional) finds r = 0.42 between store floor area and the number of product lines sold, across 200 stores, and wants to know whether the correlation is above 0.3. Then z=(0.448−0.310)×197=1.94z = (0.448 - 0.310) \times \sqrt{197} = 1.94, and the two-sided p-value is 0.052: not quite significant at 5%, which matches the 95% interval for ρ\rho, 0.299 to 0.528, whose lower end sits just below 0.3.

Tests of rank correlations

Spearman’s ρ is usually tested with the same t statistic, applied to the ranks, and Kendall’s τ with a normal approximation to its distribution. Both are approximations, good for moderate samples; for small samples without ties, exact tables or permutation tests are better. For rain and footfall at Harbourside, Spearman’s ρ = −0.226 and τ-b = −0.173, both with p below 0.001: the same conclusion as r, without relying on normality.

Power and sample size

Power, from the hypothesis-testing lesson, is the chance of rejecting H0H_0 when a particular alternative is true. Fisher’s z gives a simple approximation: with true correlation ρ\rho and n pairs, the test of ρ=0\rho = 0 rejects (two-sided, α = 0.05) with probability about Φ(atanh⁡∣ρ∣n−3−1.96)\Phi(\operatorname{atanh}|\rho|\sqrt{n-3} - 1.96). Turned round, the pairs needed for power 1−β1 - \beta are

n=(z1−α/2+z1−βatanh⁡ρ)2+3n = \left(\dfrac{z_{1-\alpha/2} + z_{1-\beta}}{\operatorname{atanh}\rho}\right)^{2} + 3
Pairs needed for 80% power, two-sided test at α = 0.05
True correlation ρ0.10.20.30.5
Pairs needed7831948530

Halving the correlation to detect roughly quadruples the pairs needed. Millbrook’s 306 days had about a 42% chance of detecting a true correlation of −0.1 between rain and footfall: its non-significant result is weak evidence of anything. And eight days had only an 18% chance of detecting a correlation as large as the year’s 0.44 between Harbourside’s high and its footfall.

Comparing two correlations

Harbourside’s rain correlation is significant and Millbrook’s is not. It is tempting to conclude that rain matters more at the waterfront, but “significant here, not significant there” is not a test of a difference. Compare the correlations directly. For two independent samples, transform each with Fisher’s z and use

z=atanh⁡r1−atanh⁡r21n1−3+1n2−3z = \dfrac{\operatorname{atanh} r_1 - \operatorname{atanh} r_2}{\sqrt{\dfrac{1}{n_1 - 3} + \dfrac{1}{n_2 - 3}}}

A cinema chain (fictional) has 90 sites in one country, where local population and annual ticket sales correlate at r = 0.48, and 110 sites in another, where r = 0.22. The sites are different cinemas, so the samples are independent. Then z = (atanh 0.48 − atanh 0.22) ÷ √(1/87 + 1/107) = 2.07, and the two-sided p-value is 0.038: at 5%, population goes with ticket sales more closely in the first country.

Ana’s two cafés are not independent samples, and the formula above doesn’t apply to them. Both correlations are measured on the same 306 days, they share the same rain (or temperature) variable, and the cafés’ daily footfalls are themselves correlated (−0.39: weekends are busy at Harbourside and quiet at Millbrook). Correlations that overlap like this need a test for dependent correlations; the usual one is Steiger’s (1980) Z, which allows for the correlation between the two footfall columns. It is beyond this course to derive, but its results are easy to read. For rain, −0.228 at Harbourside against −0.102 at Millbrook gives Z = −1.34, p = 0.18: no convincing evidence that the correlations differ. For the day’s high, 0.436 against 0.157 gives Z = 3.19, p = 0.0014. The independent-samples formula would have given z = −1.59 and 3.81: different numbers, the same conclusions.

The temperature result needs one more caution. Temperature and Harbourside’s footfall both follow the season, so neighbouring days are far from independent (see Conditions) and every p-value involving temperature here, including 0.0014, is much too small. The direction of the difference (warm weather goes with more customers at the waterfront than in the office district) is plausible for the two cafés, but its strength of evidence is overstated.

Statistical and practical significance

A significant correlation can be too small to matter, and an important one can fail to reach significance in a small sample. Judge size by r, its interval and r², in the context of the decision. Rain’s pooled r of −0.14 is significant but explains under 2% of the variation in footfall; Ana would not reschedule staff on rain forecasts on that evidence. How many customers an inch of rain costs is a slope, a question for regression in B06, not for r.

Finally, every test here is one test. Ana could test all 28 pairs of eight columns in her log, and at α = 0.05 more than one would be significant by chance even if nothing were related. The correlation-matrices lesson shows how to adjust for that.

Formulas

t test of a correlation (H₀: ρ = 0)

t=rn−21−r2,df=n−2t = \dfrac{r\sqrt{n - 2}}{\sqrt{1 - r^2}}, \qquad \text{df} = n - 2
rr
Sample Pearson correlation (CORREL)
nn
Number of pairs
tt
Test statistic, compared with the t distribution
df\text{df}
Degrees of freedom

Assumes. Independent pairs from a random sample; a linear relationship; y roughly normal around the line with constant spread.

Two-sided p-value: =T.DIST.2T(ABS(t),n-2); lower tail =T.DIST(t,n-2,TRUE); upper tail =T.DIST.RT(t,n-2).

Critical value of r

rcrit=tcritn−2+tcrit2r_{\text{crit}} = \dfrac{t_{\text{crit}}}{\sqrt{n - 2 + t_{\text{crit}}^2}}
rcritr_{\text{crit}}
Smallest |r| significant at level α
tcritt_{\text{crit}}
Critical t with n − 2 degrees of freedom: T.INV.2T(α, n − 2) for a two-sided test
nn
Number of pairs

For a one-sided test use T.INV(1 − α, n − 2).

Confidence interval for ρ by Fisher’s z

tanh⁡ ⁣(atanh⁡r±z∗n−3)\tanh\!\left(\operatorname{atanh} r \pm \dfrac{z^*}{\sqrt{n - 3}}\right)
atanh⁡r\operatorname{atanh} r
Fisher’s z of the sample correlation, ½ ln((1 + r) ÷ (1 − r)); Excel’s FISHER
z∗z^*
Standard normal critical value (1.96 for 95%)
nn
Number of pairs
tanh⁡\tanh
The inverse transformation; Excel’s FISHERINV

Assumes. Independent pairs; the two variables roughly bivariate normal.

The interval is not symmetric about r.

Test of H₀: ρ = ρ₀ by Fisher’s z

z=(atanh⁡r−atanh⁡ρ0)n−3z = \left(\operatorname{atanh} r - \operatorname{atanh}\rho_0\right)\sqrt{n - 3}
ρ0\rho_0
The population correlation under the null hypothesis
rr
Sample correlation
nn
Number of pairs
zz
Test statistic, compared with the standard normal

For ρ₀ = 0 it gives nearly the same answer as the t test, which is the usual choice.

Comparing two independent correlations

z=atanh⁡r1−atanh⁡r21n1−3+1n2−3z = \dfrac{\operatorname{atanh} r_1 - \operatorname{atanh} r_2}{\sqrt{\dfrac{1}{n_1 - 3} + \dfrac{1}{n_2 - 3}}}
r1,r2r_1, r_2
The two sample correlations
n1,n2n_1, n_2
Their numbers of pairs
zz
Test statistic, compared with the standard normal

Assumes. The two samples are independent of each other.

Two-sided p-value: =2*(1-NORM.S.DIST(ABS(z),TRUE)).

Pairs needed to detect a correlation

n=(z1−α/2+z1−βatanh⁡ρ)2+3n = \left(\dfrac{z_{1-\alpha/2} + z_{1-\beta}}{\operatorname{atanh}\rho}\right)^{2} + 3
nn
Pairs needed, rounded up
z1−α/2z_{1-\alpha/2}
Standard normal value for a two-sided test at α (1.96 for 0.05)
z1−βz_{1-\beta}
Standard normal value for the power (0.842 for 80%)
ρ\rho
The smallest true correlation worth detecting

Power at a given n: Φ(atanh|ρ| √(n − 3) − z₁₋α/₂), ignoring the tiny chance of rejecting in the wrong direction.

Worked examples

A first example: Rain and footfall at Harbourside

Fictional figures

Across Harbourside’s 306 days, the correlation between the day’s rain (inches) and footfall is r = −0.2276. Test H₀: ρ = 0 against H₁: ρ ≠ 0 at α = 0.05.

  1. Hypotheses, chosen before looking: H₀: ρ = 0 (no linear association between rain and footfall), H₁: ρ ≠ 0. Two-sided, because Ana’s question was whether rain makes any difference.
  2. Statistic: t=−0.2276×304÷1−0.0518=−3.968÷0.9738=−4.08t = -0.2276 \times \sqrt{304} \div \sqrt{1 - 0.0518} = -3.968 \div 0.9738 = -4.08, with n − 2 = 304 degrees of freedom.
  3. P-value: =T.DIST.2T(ABS(-4.075),304) = 0.00006, below 0.001. Equivalently, |r| = 0.228 exceeds the critical value for 306 pairs, 0.112.
  4. Decision: p is below 0.05, so reject H₀.
  5. Interval: the Fisher-z 95% interval for ρ runs from −0.331 to −0.118.

Answer. t = −4.08 with 304 degrees of freedom, p below 0.001: reject H₀. 95% interval for ρ: −0.331 to −0.118.

What it means. Rainier days go with fewer people through Harbourside’s door, and the association is unlikely to be chance. It is modest: even the interval’s far end, −0.33, means rain accounts for at most about a tenth of the variation in footfall. Rain is zero on two days in three, so the result largely contrasts wet days with dry ones; and since neighbouring days are alike, the p-value is somewhat smaller than it should be, though not by enough to change the decision.

A harder example: Eight days in April against a whole year

Fictional figures

In her first weeks Ana noted Harbourside’s high and footfall for 5–12 April 2027 and found r = 0.639 over the 8 days. Is that significant at α = 0.05 (two-sided)? What does the confidence interval say, how much power did 8 days have to detect the correlation the whole year turned out to show (0.436), and how many days would 80% power need?

DayHigh (°F)Footfall
Mon 5 Apr4481
Tue 6 Apr4380
Wed 7 Apr4472
Thu 8 Apr5393
Fri 9 Apr5490
Sat 10 Apr52138
Sun 11 Apr65151
Mon 12 Apr67100
  1. Test: t=0.639×6÷1−0.6392=1.565÷0.769=2.03t = 0.639 \times \sqrt{6} \div \sqrt{1 - 0.639^2} = 1.565 \div 0.769 = 2.03 with 6 degrees of freedom; =T.DIST.2T(2.033,6) = 0.088. The critical value for 8 pairs is 0.707, and 0.639 is below it. Fail to reject H₀.
  2. Interval: atanh⁡(0.639)=0.756\operatorname{atanh}(0.639) = 0.756, SE =1/5=0.447= 1/\sqrt{5} = 0.447, so z runs from 0.756−1.96×0.447=−0.1210.756 - 1.96 \times 0.447 = -0.121 to 1.632; back-transformed, ρ is between −0.120 and 0.926.
  3. Power for ρ = 0.436 with 8 pairs: atanh⁡(0.436)×5−1.96\operatorname{atanh}(0.436) \times \sqrt{5} - 1.96 is about −0.92, and Φ(−0.92)≈0.18\Phi(-0.92) \approx 0.18. Eight days would detect a correlation of that size less than one time in five.
  4. Pairs for 80% power: n=((1.960+0.842)÷atanh⁡(0.436))2+3≈38.9n = ((1.960 + 0.842) \div \operatorname{atanh}(0.436))^2 + 3 \approx 38.9, so 39 days.
  5. Compare with the year: over all 306 days r = 0.436 and t = 8.45. The p-value from the formula is below 0.001, but temperature and footfall both follow the season, so the 306 days are far from independent and that p-value is much too small; the size of r is the more trustworthy part.

Answer. Not significant: t = 2.03, 6 df, p = 0.088; 95% interval −0.120 to 0.926. Eight days had about 18% power for ρ = 0.436; 80% power needs 39 days.

What it means. A large r from a small sample is weak evidence: the interval covers almost everything from a slight negative link to a near-perfect positive one, and the test had little chance of succeeding. Failing to reject was not evidence that temperature doesn’t matter; the full year shows it does. A one-sided test would have given p = 0.044, but choosing it after seeing the direction would be p-hacking. The useful habit is to plan the number of days from the smallest correlation worth detecting before collecting the data.

Applied: a business decision: Does rain matter more at the waterfront?

Fictional figures

Ana is deciding whether to put a rain-day promotion (a free pastry with a coffee on wet days) at Harbourside only. Her evidence: rain and footfall correlate at r = −0.228 at Harbourside (p below 0.001) and r = −0.102 at Millbrook (p = 0.074), 306 days each. Does the log show that rain’s association with footfall differs between the cafés, and how large is it?

  1. Don’t compare the p-values. “Significant at Harbourside, not at Millbrook” doesn’t show a difference: Millbrook’s test had only about 42% power for a correlation of −0.1.
  2. Check whether the samples are independent. They aren’t: both correlations use the same 306 days and the same rain column, and the cafés’ daily footfalls correlate at −0.39. The independent-samples Fisher formula doesn’t apply.
  3. Use a test for dependent correlations. Steiger’s Z, which allows for the −0.39, gives Z = −1.34 and a two-sided p-value of 0.18. (Wrongly treating the cafés as independent would give z = −1.59, p = 0.11; the conclusion is the same.)
  4. Judge the size: r² is 0.052 at Harbourside and 0.010 at Millbrook. Even at Harbourside rain accounts for about 5% of the day-to-day variation in footfall.

Answer. No convincing evidence of a difference: Steiger’s Z = −1.34, p = 0.18. Both associations are small (r² of 5% and 1%).

What it means. The log supports “rainy days are a little quieter at Harbourside”, not “rain matters at Harbourside and not at Millbrook”. If Ana wants to know whether a rain-day promotion pays, the correlation can’t tell her: she could run it on some wet days and not others and compare (the correlation-and-causation lesson discusses why that is stronger evidence). Temperature looks different: 0.436 at Harbourside against 0.157 at Millbrook, Steiger’s Z = 3.19, though temperature’s seasonality makes that p-value, 0.0014, much too small.

Explore

All 612 café-days: rain against footfall. Pooled, r = −0.138 with p below 0.001 (though the 612 rows hold only 306 weather days). Tick “Colour by café” to see each café’s own r: −0.228 at Harbourside, −0.102 at Millbrook. Note how narrow the 95% interval is with 612 pairs.

Loading the interactive…

Set r and n and read t, the p-value, the critical value of r and the Fisher-z interval. Try r = 0.64 with n = 8, then with n = 30; then r = 0.14 with n = 612 and with n = 50. The chart shows how the critical value falls as n grows.

Loading the interactive…

How many pairs does a study need? Set the smallest correlation worth detecting and the power you want; the panel shows the pairs needed and the power of Ana’s 306 days. Halve ρ and watch n roughly quadruple.

Loading the interactive…

The eight April days with the whole test as formulas: CORREL, the t statistic, T.DIST.2T, the critical r and the Fisher-z interval with FISHER and FISHERINV. Change a footfall figure, or the confidence level in E9, and watch every result update.

Loading the interactive…

Common mistakes

  • “p is below 0.001, so the correlation is strong.”

    The p-value measures how surprising r would be if ρ were 0; with hundreds of pairs even a trivial r passes. Rain’s pooled r = −0.14 is significant with 612 pairs and explains under 2% of the variation in footfall. Report r, its interval and r².

  • “r = 0.64 isn’t significant, so temperature and footfall are unrelated.”

    With 8 pairs the critical value is 0.707 and the test had about 18% power for the true correlation. Failing to reject is a lack of evidence, not evidence of no link; the interval, −0.12 to 0.93, shows how little 8 days can say.

  • “Harbourside is significant and Millbrook isn’t, so rain matters more at Harbourside.”

    A difference in significance is not a significant difference. Test the difference directly: with Fisher’s z for independent samples, or, because the two cafés share their days, with a test for dependent correlations such as Steiger’s Z (for rain, Z = −1.34, p = 0.18).

  • Building the interval as r ± 1.96 × SE

    The sampling distribution of r is skewed and bounded by ±1, so a symmetric interval can be wrong or even run past 1. Transform with FISHER, add and subtract 1.96 ÷ √(n − 3), and transform back with FISHERINV.

  • Treating 612 rows as 612 independent observations

    Pooling the cafés repeats each day’s rain twice, and neighbouring days are alike. The test assumes independent pairs; when that fails its p-values are too small. Analyse each café separately and treat p-values from daily series as approximate.

  • Choosing the one-sided test after seeing the result

    Millbrook’s two-sided p = 0.074 becomes 0.037 one-sided. Unless the one-sided question was fixed before the data were seen, halving the p-value doubles the real chance of a false alarm.

Guided practice

Work through these with hints when you need them. Every hint and every worked solution is there to be used.

Loading four questions…

On your own

No hints this time. Answer, check, and read the feedback; the solution appears once you have answered or if you ask for it. Your first answers count toward mastery.

Loading six questions…

In practice

Fictional case

Ana’s note on weather for the year-end review reads: “Rain: at Harbourside, r = −0.23 between rain and footfall (306 days; 95% CI −0.33 to −0.12; p < 0.001); at Millbrook r = −0.10 (CI −0.21 to 0.01; p = 0.07). The difference between the cafés is not significant (Steiger’s test for correlations on the same days, p = 0.18). Rain accounts for about 5% of the day-to-day variation in footfall at Harbourside and 1% at Millbrook. Temperature matters more at the waterfront: r = 0.44 at Harbourside against 0.16 at Millbrook (Steiger’s Z = 3.19). Temperature and footfall both follow the season, so the temperature p-values overstate the evidence; days are not independent, so treat all p-values as approximate.”

The note gives every correlation with its interval and its n, says which test was used, and separates three questions that are easily blurred: is there an association (the test), how large is it (r, r² and the interval), and does it differ between groups (the comparison). It also states the limitation that matters most for daily data. A manager reading it can see that the rain effect is real but small, and that temperature, not rain, is the weather variable worth planning around at Harbourside.

The same pattern appears wherever correlations are reported. A retailer with millions of loyalty-card transactions will find significant correlations everywhere, and must ask which are large enough to act on. A hotel testing whether guest satisfaction tracks room price at its 12 properties can’t expect significance for anything but a very strong link, and should plan more data (or report the interval) rather than conclude “no relationship”. A battery-storage installer comparing the correlation between site temperature and system efficiency in two regions, with different sites in each, needs the Fisher-z comparison, not two separate p-values.

Two habits carry over. Plan the sample from the smallest correlation that would change a decision: 85 pairs for ρ = 0.3 at 80% power, 783 for ρ = 0.1. And when a correlation is significant, remember it is still only an association: whether warm days bring customers to the waterfront or something else drives both is the correlation-and-causation lesson’s question.

Knowledge check

Six questions, one attempt each, no hints. Score 80% or more to complete the lesson; you can take it again at any time.

Loading six questions…

Summary

  • Test H₀: ρ = 0 with t = r√(n − 2) ÷ √(1 − r²) and n − 2 degrees of freedom: =T.DIST.2T(ABS(t),n-2) two-sided. Choose one- or two-sided before seeing the data.
  • The critical |r| falls fast with n: 0.707 for 8 pairs, 0.197 for 100, 0.079 for 612. Large samples make small correlations significant; small samples leave large ones unproven.
  • A confidence interval for ρ uses Fisher’s z: atanh(r) ± 1.96 ÷ √(n − 3), transformed back with tanh (FISHER and FISHERINV). It is not symmetric about r.
  • Pairs needed for 80% power, two-sided at 5%: about 783 for ρ = 0.1, 194 for 0.2, 85 for 0.3 and 30 for 0.5.
  • Compare two independent correlations with Fisher’s z, not by their separate p-values. Correlations measured on the same days or people are dependent and need a test such as Steiger’s Z.
  • Significance is not size: report r, its interval and r², and judge whether the association matters for the decision.
  • The test assumes independent pairs and a linear relationship: plot first, and treat p-values from daily series that follow the season (temperature, footfall) as much too small.

Key formulas

Terms introduced

Population correlation
The correlation between two variables across the whole population the sample comes from, written ρ (rho). A sample correlation r estimates it.
Critical value of r
The smallest absolute value of a sample correlation that is statistically significant at a chosen level for a given number of pairs: t_crit ÷ √(n − 2 + t_crit²).
Fisher’s z transformation
z = atanh(r) = ½ ln((1 + r) ÷ (1 − r)), which turns a correlation into a quantity that is close to normally distributed with standard error 1 ÷ √(n − 3). Used for confidence intervals for ρ and for comparing correlations. Excel’s FISHER; FISHERINV reverses it.
Independent samples
Two samples whose values are unrelated, such as separate groups of customers or calls, so that nothing links a value in one sample to a particular value in the other.

Sources

  1. Illowsky, B. & Dean, S. (2023). Introductory Statistics 2e, section 12.4, “Testing the Significance of the Correlation Coefficient”. OpenStax. openstax.org/books/introductory-statistics-2e/pages/12-4-tes…
  2. Holmes, A., Illowsky, B. & Dean, S. (2023). Introductory Business Statistics 2e, section 13.2, “Testing the Significance of the Correlation Coefficient”. OpenStax. openstax.org/books/introductory-business-statistics-2e/pages…
  3. Microsoft Support. “FISHER function”. support.microsoft.com/en-US/excel/functions/fisher-function
  4. Microsoft Support. “FISHERINV function”. support.microsoft.com/en-US/excel/functions/fisherinv-functi…