Markdown Editor

Correlation Method Card Template (Statistics, R and Python)

Correlation method card – Pearson, Spearman, Kendall, partial correlation, Fisher z CIs, influence, restriction of range and confounding, with R and Python

학술전체Pearson (1896); Spearman (1904); Kendall (1938); Fisher (1915, 1921); Anscombe (1973); Steiger (1980); NIST/SEMATECH e-Handbookstatscorrelationmath

사용법: Use it when you need one number for the association between two variables. Draw the scatter plot first, choose Pearson, Spearman or Kendall from the shape and measurement level, report r with its Fisher z CI, and check influential points and confounders with partial correlation. The main pitfall is reading a correlation as a causal effect, or trusting r without looking at the plot.

미리보기

Correlation Method Card: [Your study question or course]

A method card for measuring and testing the association between two variables: Pearson's r, Spearman's rho, Kendall's tau, partial correlation, confidence intervals through Fisher's z, and the comparison of two correlations. It covers the assumptions, the influence of single points, restriction of range, and why a correlation is not a causal effect. It is for students preparing for an exam, master's and PhD students exploring thesis data, and analysts who need a quick, honest measure of association. It speeds up learning by putting the decisions in order (which coefficient, which checks, which interval, which sentence to report), by showing one example fully solved, one half solved and one left for you, and by ending with self-test questions whose answers sit in a separate key. The worked examples use fictional data; replace them with your own. Source basis: Pearson (1896), Spearman (1904), Kendall (1938), Fisher (1915, 1921), Anscombe (1973), the NIST/SEMATECH e-Handbook of Statistical Methods, and the R and SciPy documentation, all written up in original words and examples.

Document control

FieldValue
Course or project[STAT 101 / thesis chapter 4 / client project]
Learner or analyst[Your name]
Data set[Lakemoor University sleep and quiz study, 15 students (fictional) / your data set and source]
Software and versionsR 4.5.1 (stats); Python 3.14 with numpy 2.5.4, pandas 3.1.0, scipy 1.18.1, statsmodels 0.15.0
DateYYYY-MM-DD
Version[0.1]

When to use it

One-sentence rule: use a correlation coefficient when you want one number for the strength and direction of the association between two variables measured on the same units, with neither variable treated as the outcome.

There are three common coefficients, and the data decide which one you use:

  • Pearson's r: the strength of the linear relation between two quantitative variables. It is the most efficient choice when the relation is linear and there are no extreme points, and it is the one most readers expect.
  • Spearman's rho: Pearson's r computed on the ranks. It measures monotonic association (as one goes up, the other tends to go up, not necessarily in a straight line), and is resistant to outliers. Use it for ordinal data or curved but monotonic relations.
  • Kendall's tau: the difference between the proportions of concordant and discordant pairs. Also rank-based; it has a direct probability reading and behaves well with small samples and many ties. Its values are usually smaller than rho for the same data, so do not compare tau with rho or r on the same scale.

Partial correlation measures the association between two variables after removing the linear effect of one or more other variables from both.

Use whenDo not use when
Two quantitative or ordinal variables measured on the same unitsOne variable is nominal with more than two categories (use group comparisons or Cramér's V)
You want a symmetric measure of associationYou want to predict Y from X or estimate a slope in units (use regression)
The relation is linear (Pearson) or monotonic (Spearman, Kendall)The relation is U-shaped or otherwise non-monotonic (r near 0 hides a strong pattern)
Observations are independent pairsRepeated measures on the same people are pooled (use repeated-measures correlation or a mixed model)
You want to describe, then perhaps test, an associationYou want to claim that X causes Y (needs a design, not a coefficient)

Alternatives: simple linear regression when one variable is the outcome (academic/stats-linear-regression); Cramér's V or phi for two categorical variables (academic/stats-contingency-tables); point-biserial correlation (it is Pearson's r with a 0/1 variable) or a t-test for a binary and a quantitative variable (academic/stats-t-tests); intraclass correlation for agreement between raters (academic/stats-reliability-factor-analysis); bootstrap CIs for any coefficient (academic/stats-resampling-methods).

The question and the data

Question (example). Among Lakemoor University STAT 101 students (fictional), is average nightly sleep associated with the week 6 quiz score, and does the association remain once weekly study hours are taken into account? Unit: one student. Variables: sleep (hours per night, average over two weeks, ratio scale), study (hours per week, ratio), quiz (score out of 20, treated as interval). Design: observational, one measurement per student, n = 15.

StudentSleep (h)Study (h/week)Quiz (/20)StudentSleep (h)Study (h/week)Quiz (/20)
15.531198.4717
26.0613105.1312
36.5412116.8414
47.0515126.6613
57.5716137.7514
68.0614147.9818
76.2210155.8411
87.1815

Correlation matrix (Pearson): sleep and quiz 0.813; sleep and study 0.711; study and quiz 0.856. Study hours are strongly related to both sleep and quiz, so they are a candidate confounder: part of the sleep-quiz association may exist because students who study more also sleep more (a more organised week) and score higher.

Assumptions and how to check each

AssumptionCheckRPythonIf violated
Independent pairs (one row per unit)Design: no repeated measures, no clustersn/an/aRepeated-measures correlation, mixed model, or one value per unit
Linear relation (Pearson)Scatter plot; add a smootherplot(x, y); lines(lowess(x, y))plt.scatter(x, y)Spearman or Kendall for monotonic; transform; regression with a curve
No single point dominatingScatter; r with and without each pointcor(x[-i], y[-i])np.corrcoef(np.delete(x, i), np.delete(y, i))Check the point; report both; use Spearman
Bivariate normality, only for the Pearson test and Fisher CIQ-Q plots of each variable; look for skew and outliersqqnorm(x)stats.probplot(x, plot=plt)Spearman or Kendall; bootstrap CI
Full range of both variables sampledCompare observed range with the population rangerange(x)x.min(), x.max()Report the restriction; do not generalise beyond the range
Ties (rank methods)Count repeated valuessum(duplicated(x))x.duplicated().sum()Kendall's tau-b; asymptotic p-values (both programs warn or switch)

How it works

Pearson's r asks: when a student is above average on X, are they also above average on Y, and by how much in standard units? It multiplies each student's two z-scores, adds the products and averages them. Points in the upper-right and lower-left quadrants (both above or both below the means) add positive products; points in the other two quadrants add negative ones. The result lies between -1 and +1. r2r^2 is the proportion of the variance of Y that a straight line in X accounts for (and vice versa).

r=∑i=1n(xi−xˉ)(yi−yˉ)∑i=1n(xi−xˉ)2∑i=1n(yi−yˉ)2=1n−1∑i=1nzx,i zy,ir = \frac{\sum_{i=1}^{n}(x_i - \bar{x})(y_i - \bar{y})}{\sqrt{\sum_{i=1}^{n}(x_i - \bar{x})^2}\sqrt{\sum_{i=1}^{n}(y_i - \bar{y})^2}} = \frac{1}{n-1}\sum_{i=1}^{n} z_{x,i}\, z_{y,i}

Test of H0:ρ=0H_0: \rho = 0, with df =n−2= n - 2:

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

Spearman's rho is Pearson's formula applied to the ranks R(xi)R(x_i) and R(yi)R(y_i). Without ties it simplifies to

rs=1−6∑di2n(n2−1),di=R(xi)−R(yi)r_s = 1 - \frac{6\sum d_i^2}{n(n^2 - 1)}, \qquad d_i = R(x_i) - R(y_i)

Kendall's tau compares every pair of units. A pair is concordant if the unit higher on X is also higher on Y, and discordant if it is lower. With CC concordant and DD discordant pairs and no ties, τ=(C−D)/(n2)\tau = (C - D)/\binom{n}{2}. Tau-b (the version R and SciPy report) adjusts the denominator for ties.

Fisher's z and the confidence interval. The sampling distribution of r is skewed when ρ≠0\rho \neq 0, so the CI is built on a transformed scale where it is close to normal, then transformed back:

z′=artanh⁡(r)=12ln⁡1+r1−r,SEz′=1n−3,CI=tanh⁡(z′±1.96 SEz′)z' = \operatorname{artanh}(r) = \frac{1}{2}\ln\frac{1 + r}{1 - r}, \qquad SE_{z'} = \frac{1}{\sqrt{n - 3}}, \qquad \text{CI} = \tanh\left(z' \pm 1.96\, SE_{z'}\right)

The interval is not symmetric around r on the original scale; it is longer on the side towards zero.

Comparing two independent correlations (two separate samples):

z=z1′−z2′1n1−3+1n2−3z = \frac{z'_1 - z'_2}{\sqrt{\dfrac{1}{n_1 - 3} + \dfrac{1}{n_2 - 3}}}

Correlations from the same sample that share a variable (for example rXYr_{XY} and rXZr_{XZ}) are dependent, and need a different test (Steiger 1980), not this formula.

Partial correlation of X and Y given Z: regress X on Z and Y on Z, and correlate the two sets of residuals. With one control variable,

rXY⋅Z=rXY−rXZ rYZ(1−rXZ2)(1−rYZ2),t=rXY⋅Zn−31−rXY⋅Z2,df=n−3r_{XY \cdot Z} = \frac{r_{XY} - r_{XZ}\, r_{YZ}}{\sqrt{(1 - r_{XZ}^2)(1 - r_{YZ}^2)}}, \qquad t = r_{XY \cdot Z}\sqrt{\frac{n - 3}{1 - r_{XY \cdot Z}^2}}, \quad \text{df} = n - 3

Each extra control variable removes one more degree of freedom.

SymbolMeaning
nnSample size (number of pairs)
rr, ρ\rhoSample and population Pearson correlation
rsr_sSpearman's rank correlation (rho)
τ\tauKendall's tau (tau-b with ties)
zx,iz_{x,i}z-score of xix_i, using ss with divisor n−1n - 1
z′z'Fisher-transformed correlation
SEz′SE_{z'}Standard error on the Fisher scale
rXY⋅Zr_{XY \cdot Z}Partial correlation of X and Y controlling for Z
C,DC, DNumbers of concordant and discordant pairs
dfDegrees of freedom

Choosing the coefficient:

Influence: one point can make the correlation

The scatter below shows 11 Lakemoor students' daily coffee cups and quiz scores (fictional). Ten students show a weak negative pattern (r = -0.293). One student drank 9 cups and scored 88. With that one student included, Pearson's r jumps to 0.801 (p = .003); Spearman's rho, which only sees that student as "most cups, highest score", is 0.023. The red line is the least-squares fit with all 11 students (score = 58.08 + 2.76 × cups); the grey line excludes student 11 (score = 63.06 - 0.90 × cups).

all 11            Pearson r = 0.801 (p = 0.003)  Spearman rho = 0.023 (p = 0.946)
without point 11  Pearson r = -0.293 (p = 0.411)  Spearman rho = -0.313 (p = 0.379)

A point far from the others in X has high leverage: it acts like a lever on the line and on r. The lesson is not "delete it", but "look at it": check whether it is an error, report r with and without it, and consider a rank-based coefficient. Anscombe (1973) built four data sets with the same r (0.816) and very different pictures to make the same point.

Restriction of range

If you sample only part of the range of X, the correlation usually shrinks. In the sleep data, r = 0.813 for all 15 students but only 0.369 for the 7 students who sleep 7 hours or more. Nothing about the relationship changed; the smaller spread of X leaves less signal relative to the scatter. Typical cases: admission test scores correlated with grades among admitted students only, or a study recruited only from high performers. Say so in the limitations and do not generalise beyond the observed range.

Correlation, causation and confounding

A correlation between X and Y can arise because X affects Y, Y affects X, a third variable affects both (confounding), or because of how units were selected (selection bias), or by chance. The diagram shows the confounding story for the example.

Partial correlation removes the linear effect of the measured confounder. It cannot remove confounders you did not measure, so it never turns an observational correlation into a causal estimate. For causal questions, randomise (academic/stats-experiment-design) or use a design for observational data with stated assumptions (science/observational-study).

Worked example A (fully solved): sleep and quiz score

Step 1. Plot. The scatter of quiz against sleep (not shown; draw it with plot(lab$sleep, lab$quiz)) rises roughly linearly with no isolated points. Pearson is appropriate; the rank coefficients are reported as a check.

Step 2. Hypotheses. H0:ρ=0H_0: \rho = 0; H1:ρ≠0H_1: \rho \neq 0; α=0.05\alpha = 0.05, two-sided.

Step 3. Checks. 15 students, one row each (independent pairs). Sleep ranges 5.1 to 8.4 hours, a reasonable spread. No point dominates: dropping any one student leaves r between 0.773 and 0.850. Ties: quiz has repeated values (11, 12, 13, 14, 15 occur more than once), so rank methods use tie corrections and asymptotic p-values.

R code:

lab <- data.frame(
  sleep = c(5.5, 6.0, 6.5, 7.0, 7.5, 8.0, 6.2, 7.1, 8.4, 5.1, 6.8, 6.6, 7.7, 7.9, 5.8),
  study = c(3, 6, 4, 5, 7, 6, 2, 8, 7, 3, 4, 6, 5, 8, 4),
  quiz  = c(11, 13, 12, 15, 16, 14, 10, 15, 17, 12, 14, 13, 14, 18, 11)
)
cor.test(lab$sleep, lab$quiz)                       # Pearson (default)
cor.test(lab$sleep, lab$quiz, method = "spearman")
cor.test(lab$sleep, lab$quiz, method = "kendall")
# Partial correlation by residuals
ex <- resid(lm(sleep ~ study, data = lab))
ey <- resid(lm(quiz ~ study, data = lab))
pr <- cor(ex, ey); n <- nrow(lab)
t <- pr * sqrt((n - 3) / (1 - pr^2))
round(c(partial_r = pr, t = t, df = n - 3, p = 2 * pt(-abs(t), n - 3)), 4)
round(cor(lab), 3)
	Pearson's product-moment correlation

data:  lab$sleep and lab$quiz
t = 5.032, df = 13, p-value = 0.0002296
alternative hypothesis: true correlation is not equal to 0
95 percent confidence interval:
 0.5151007 0.9355631
sample estimates:
      cor
0.8128732

	Spearman's rank correlation rho

data:  lab$sleep and lab$quiz
S = 90.635, p-value = 9.537e-05
alternative hypothesis: true rho is not equal to 0
sample estimates:
      rho
0.8381512

Warning message:
In cor.test.default(lab$sleep, lab$quiz, method = "spearman") :
  Cannot compute exact p-value with ties

	Kendall's rank correlation tau

data:  lab$sleep and lab$quiz
z = 3.3972, p-value = 0.0006809
alternative hypothesis: true tau is not equal to 0
sample estimates:
      tau
0.6703494

Warning message:
In cor.test.default(lab$sleep, lab$quiz, method = "kendall") :
  Cannot compute exact p-value with ties
partial_r         t        df         p
   0.5614    2.3501   12.0000    0.0367
      sleep study  quiz
sleep 1.000 0.711 0.813
study 0.711 1.000 0.856
quiz  0.813 0.856 1.000

Python code:

import numpy as np, pandas as pd
from scipy import stats
import statsmodels.formula.api as smf

lab = pd.DataFrame({
    "sleep": [5.5, 6.0, 6.5, 7.0, 7.5, 8.0, 6.2, 7.1, 8.4, 5.1, 6.8, 6.6, 7.7, 7.9, 5.8],
    "study": [3, 6, 4, 5, 7, 6, 2, 8, 7, 3, 4, 6, 5, 8, 4],
    "quiz":  [11, 13, 12, 15, 16, 14, 10, 15, 17, 12, 14, 13, 14, 18, 11],
})
n = len(lab)
x, y = lab["sleep"], lab["quiz"]

r = stats.pearsonr(x, y)
print(f"Pearson r = {r.statistic:.4f}, p = {r.pvalue:.6f}, 95% CI {np.round(r.confidence_interval(0.95), 4)}")
rho = stats.spearmanr(x, y)
print(f"Spearman rho = {rho.statistic:.4f}, p = {rho.pvalue:.6f}")
tau = stats.kendalltau(x, y)
print(f"Kendall tau-b = {tau.statistic:.4f}, p = {tau.pvalue:.6f}")

# Fisher z confidence interval by hand
z = np.arctanh(r.statistic); se = 1 / np.sqrt(n - 3)
print(f"z = {z:.4f}, SE = {se:.4f}, CI = {np.round(np.tanh([z - 1.959964*se, z + 1.959964*se]), 4)}")

# Partial correlation of sleep and quiz, controlling for study (residual method)
ex = smf.ols("sleep ~ study", data=lab).fit().resid
ey = smf.ols("quiz ~ study", data=lab).fit().resid
pr = np.corrcoef(ex, ey)[0, 1]
t = pr * np.sqrt((n - 3) / (1 - pr**2))
print(f"partial r = {pr:.4f}, t({n-3}) = {t:.3f}, p = {2*stats.t.sf(abs(t), n-3):.4f}")
print(lab.corr().round(3))

# Restriction of range: only students sleeping 7 h or more
sub = lab[lab["sleep"] >= 7]
print(f"n = {len(sub)}, r (sleep >= 7) = {sub['sleep'].corr(sub['quiz']):.3f}")

# Comparing two independent correlations (Fisher z test)
r1, n1, r2, n2 = 0.813, 15, 0.35, 40
zd = (np.arctanh(r1) - np.arctanh(r2)) / np.sqrt(1/(n1 - 3) + 1/(n2 - 3))
print(f"z = {zd:.3f}, p = {2*stats.norm.sf(abs(zd)):.4f}")
Pearson r = 0.8129, p = 0.000230, 95% CI [0.5151 0.9356]
Spearman rho = 0.8382, p = 0.000095
Kendall tau-b = 0.6703, p = 0.000681
z = 1.1354, SE = 0.2887, CI = [0.5151 0.9356]
partial r = 0.5614, t(12) = 2.350, p = 0.0367
       sleep  study   quiz
sleep  1.000  0.711  0.813
study  0.711  1.000  0.856
quiz   0.813  0.856  1.000
n = 7, r (sleep >= 7) = 0.369
z = 2.319, p = 0.0204

Step 4. By hand: the t statistic. t=0.812913/(1−0.81292)=0.812913/0.3392=0.8129×6.191=5.03t = 0.8129\sqrt{13/(1 - 0.8129^2)} = 0.8129\sqrt{13/0.3392} = 0.8129 \times 6.191 = 5.03, df = 13, matching R's t = 5.032.

Step 5. By hand: the Fisher CI. z′=artanh⁡(0.8129)=1.1354z' = \operatorname{artanh}(0.8129) = 1.1354; SE=1/12=0.2887SE = 1/\sqrt{12} = 0.2887; 1.1354±1.96×0.2887=[0.5696,1.7012]1.1354 \pm 1.96 \times 0.2887 = [0.5696, 1.7012]; back-transformed with tanh: [0.515, 0.936]. R and SciPy give the same interval because both use Fisher's z.

Step 6. Effect size. r itself is the effect size: 0.81 is large by Cohen's (1988) rough benchmarks (0.1 small, 0.3 medium, 0.5 large), but benchmarks are a last resort; compare with correlations usually found in your field. r2=0.66r^2 = 0.66: a straight line in sleep accounts for about two thirds of the variance in quiz scores in this sample.

Step 7. Partial correlation. Controlling for study hours, the sleep-quiz correlation falls from 0.813 to 0.561, t(12) = 2.35, p = .037. The association is weaker but still present once study time is held constant. Check with the formula: (0.813−0.711×0.856)/(1−0.7112)(1−0.8562)=0.2044/0.3635=0.56(0.813 - 0.711 \times 0.856)/\sqrt{(1 - 0.711^2)(1 - 0.856^2)} = 0.2044/0.3635 = 0.56.

Step 8. Interpretation. Students who slept more tended to score higher on the quiz. Part of that association is shared with study hours. The design is observational, so the result does not show that more sleep raises scores.

APA-style report sentence. "Average nightly sleep was positively correlated with quiz score, r(13) = .81, p < .001, 95% CI [.52, .94], n = 15 (Spearman's rsr_s = .84). Controlling for weekly study hours, the partial correlation was smaller, rsleep,quiz⋅studyr_{\text{sleep,quiz} \cdot \text{study}} = .56, t(12) = 2.35, p = .037."

Where R and Python differ by design.

PointR cor.testSciPyNote
Pearson CIFisher z, shown by defaultpearsonr(...).confidence_interval() (Fisher z)Same numbers
Spearman p with tiesAsymptotic t approximation, warning "Cannot compute exact p-value with ties"spearmanr always uses the t approximationSame here (p = 0.000095)
Spearman p without tiesAlgorithm AS 89 by default (n up to about 1290): exact permutation p for n < 10, an Edgeworth series approximation for larger nspearmanr has no exact option: always the t approximation (use stats.permutation_test for an exact p)Differ for small n: in Exercise C (n = 8), R gives the exact p = .0004 and SciPy p = .00003
Kendalltau-b; exact p when no ties and n < 50, else normal approximationtau-b; method="auto" picks exact when there are no ties and n is 33 or lessSame here (normal approximation because of ties)
Partial correlationNo base function; residual method (or the ppcor package)No function in scipy or statsmodels; residual methodSame numbers

Worked example B (half solved): another cohort and a comparison

A second Lakemoor cohort of n = 40 students gives r = 0.35 between sleep and quiz.

  1. Fisher transform: z′=artanh⁡(0.35)=z' = \operatorname{artanh}(0.35) = [ ].
  2. Standard error: SE=1/40−3=SE = 1/\sqrt{40 - 3} = [ ].
  3. CI on the z scale: z′±1.96×SE=z' \pm 1.96 \times SE = [ , ].
  4. Back-transform with tanh: 95% CI for ρ\rho = [ , ].
  5. Test of ρ=0\rho = 0: t=0.3538/(1−0.352)=t = 0.35\sqrt{38/(1 - 0.35^2)} = [ ], df = [ ], p = .027.
  6. Compare with the first cohort (r = 0.813, n = 15): z=(1.1354−0.3654)/1/12+1/37=2.319z = (1.1354 - 0.3654)/\sqrt{1/12 + 1/37} = 2.319, p = .020. What does this comparison tell you, and what should you be cautious about? [ ]

Exercise C (unsolved): Harbour City Library visitors and loans

Harbour City Library (fictional) records daily visitors and books loaned on 8 days:

Day12345678
Visitors120135150160180200210240
Loans4850615870758390
  1. Draw the scatter plot. Is Pearson appropriate?
  2. Compute r (use software for the sums) and the t statistic with its df.
  3. Compute the 95% CI with Fisher's z.
  4. Compute Spearman's rho from the rank differences by hand (there are no ties).
  5. Run cor.test(..., method = "spearman") in R and stats.spearmanr in Python. Why are the p-values different?
  6. Write an APA-style sentence, and one sentence on what the correlation does and does not tell the library manager.

Reading software output

Output lineMeaningReport it?
t = 5.032, df = 13Test statistic for ρ=0\rho = 0, df =n−2= n - 2Report df in brackets: r(13)
p-value = 0.0002296Two-sided p-valueYes, as p < .001
95 percent confidence interval: 0.515 0.936Fisher z interval for ρ\rhoYes, always
cor 0.8128732Sample Pearson rYes, two decimals, no leading zero in APA style
S = 90.635 (Spearman)Sum of squared rank differences statisticNo; report rho and p
z = 3.3972 (Kendall)Normal approximation statisticOptional
Cannot compute exact p-value with tiesTies present, so an approximation is usedMention ties if p is borderline
partial_r 0.5614, df 12Partial correlation and its df =n−2−k= n - 2 - kYes, with the control variables named

Reporting template

Fill-in sentence. "[X] was [positively / negatively] correlated with [Y], r([n - 2]) = [.xx], p = [.xxx], 95% CI [[.xx], [.xx]], n = [ ]. [Spearman's rsr_s = [.xx] gave the same conclusion.] [Controlling for [Z], the partial correlation was [.xx], t([n - 3]) = [ ], p = [ ].]"

Pairnr95% CIpSpearman rsr_sNote
Example: sleep, quiz15.81[.52, .94]< .001.84Partial r given study = .56
Example: sleep, study15.71[ ][ ][ ]
[pair][ ][ ][ ][ ][ ][ ]

Results checklist.

  • Scatter plot drawn (and shown for the key pairs).
  • Coefficient chosen for a stated reason (linear vs monotonic, outliers, ties).
  • r, df (or n), p and 95% CI reported.
  • Influential points checked; r with and without them if they matter.
  • Range of each variable reported; restriction of range discussed.
  • Confounders named; partial correlation or regression used where measured.
  • No causal wording ("led to", "improves") for observational data.
  • Multiple correlations: number of tests stated and multiplicity handled (academic/stats-hypothesis-testing).

Common mistakes and misconceptions

Wrong statementCorrect statement
"r = 0 means the variables are unrelated."r = 0 means no linear relation; a perfect U-shape can give r = 0
"r = 0.80 means 80% of Y is explained by X."r2r^2 = 0.64 is the share of variance a straight line accounts for, in this sample
"A significant correlation is a strong one."With n = 1,000, r = 0.07 is significant at .05; significance depends on n, strength does not
"r = 0.81 shows that sleep improves scores."Observational correlation is not causation; confounding (study hours) and reverse paths are possible
"The partial correlation removes all confounding."It removes only the linear effect of the measured control variables
"The CI is r ± 1.96 SE."Use Fisher's z; the CI is asymmetric on the r scale
"Spearman and Kendall measure the same thing on the same scale."Both are rank-based, but tau is usually smaller than rho for the same data
"Removing the outlier gives the true r."Report both; delete only proven errors
"A low r in my selected sample means the relation is weak in the population."Restriction of range lowers r; the full population may show a stronger relation
"Pooling repeated measures from the same people gives more power."Pairs are not independent; use a repeated-measures method
"Two correlations differ because one is significant and the other is not."Test the difference directly (Fisher z for independent samples)

Self-test questions

  1. Ten points give r = -0.29; adding one point far to the right and high gives r = 0.80. What is this property called, and what should you report?
  2. Why is the 95% CI for r = 0.81 with n = 15 not symmetric around 0.81?
  3. You correlate an admission test with first-year grades among admitted students only and find r = 0.15. Why might the true relation among all applicants be stronger?
  4. A study reports r = 0.45 (p = .03) in women and r = 0.20 (p = .31) in men and concludes that the relation differs by gender. What is the correct way to check that claim?
  5. For ordinal data (a 5-point satisfaction item) and a small sample with many ties, which coefficient would you choose, and why?
  6. The correlation between sleep and quiz drops from 0.81 to 0.56 after controlling for study hours. Give two different causal stories consistent with this result.

My notes and next steps

ItemEntry
Confidence choosing a coefficient (1-5)[ ]
Confidence with Fisher z CIs (1-5)[ ]
Confidence explaining confounding (1-5)[ ]
Open questions[What I am still unsure about]
Mistakes to log[Link to academic/stats-error-log entry]
Next review datesYYYY-MM-DD (2 days), YYYY-MM-DD (1 week), YYYY-MM-DD (1 month)
Next template[academic/stats-linear-regression / academic/stats-effect-sizes]

Sources and further reading

Based on the original method papers listed below and the NIST/SEMATECH e-Handbook of Statistical Methods; all text, data and examples are original.

  • Pearson, K. (1896). Mathematical contributions to the theory of evolution. III. Regression, heredity, and panmixia. Philosophical Transactions of the Royal Society of London, Series A, 187, 253–318.
  • Spearman, C. (1904). The proof and measurement of association between two things. American Journal of Psychology, 15(1), 72–101.
  • Kendall, M. G. (1938). A new measure of rank correlation. Biometrika, 30(1–2), 81–93.
  • Fisher, R. A. (1915). Frequency distribution of the values of the correlation coefficient in samples from an indefinitely large population. Biometrika, 10(4), 507–521.
  • Fisher, R. A. (1921). On the "probable error" of a coefficient of correlation deduced from a small sample. Metron, 1(4), 3–32.
  • Anscombe, F. J. (1973). Graphs in statistical analysis. The American Statistician, 27(1), 17–21.
  • Steiger, J. H. (1980). Tests for comparing elements of a correlation matrix. Psychological Bulletin, 87(2), 245–251.
  • Cohen, J. (1988). Statistical Power Analysis for the Behavioral Sciences (2nd ed.). Lawrence Erlbaum Associates.
  • NIST/SEMATECH e-Handbook of Statistical Methods, section 1.3.3.26 Scatter Plot, https://www.itl.nist.gov/div898/handbook/ (accessed 2026-10-25). Public domain.
  • Further reading (by name only): de Smith, M. J. (2024). Statistical Analysis Handbook (2024 edition, StatsRef); Diez, D. M., Çetinkaya-Rundel, M., and Barr, C. D., OpenIntro Statistics (CC BY-SA); American Psychological Association, Publication Manual (7th ed.) and JARS-Quant.
  • Software documentation: R cor(), cor.test(); SciPy stats.pearsonr(), stats.spearmanr(), stats.kendalltau().

Answer key

Worked example B. (1) z′=0.3654z' = 0.3654. (2) SE=1/37=0.1644SE = 1/\sqrt{37} = 0.1644. (3) 0.3654±0.3222=[0.0432,0.6877]0.3654 \pm 0.3222 = [0.0432, 0.6877]. (4) tanh⁡\tanh gives 95% CI [0.04, 0.60]. (5) t=0.3538/0.8775=0.35×6.581=2.30t = 0.35\sqrt{38/0.8775} = 0.35 \times 6.581 = 2.30, df = 38, p = .027. (6) The two cohorts' correlations differ more than sampling error alone would usually produce (z = 2.32, p = .020): the association looks weaker in the second cohort. Cautions: the first cohort is small (its CI is [.52, .94]), the cohorts may differ in range of sleep (restriction of range) or measurement, and the comparison was not planned in advance.

Exercise C. (1) The points rise almost on a straight line with no isolated point; Pearson is appropriate. (2) r = 0.987, t=0.9876/(1−0.9872)=14.98t = 0.987\sqrt{6/(1 - 0.987^2)} = 14.98, df = 6, p < .001. (3) z′=artanh⁡(0.987)=2.51z' = \operatorname{artanh}(0.987) = 2.51, SE=1/5=0.447SE = 1/\sqrt{5} = 0.447, CI on the z scale [1.63, 3.39], back-transformed [0.93, 1.00] (R: [0.927, 0.998]). (4) Visitor ranks 1 to 8; loan ranks 1, 2, 4, 3, 5, 6, 7, 8; dd = 0, 0, -1, 1, 0, 0, 0, 0; ∑d2=2\sum d^2 = 2; rs=1−6×2/(8×63)=1−12/504=0.976r_s = 1 - 6 \times 2/(8 \times 63) = 1 - 12/504 = 0.976. (5) Both give rho = 0.976. R reports an exact permutation p-value (p = .0004, statistic S = 2) because there are no ties and n is below 10; SciPy's spearmanr uses a t approximation (p = .00003). For small n, prefer the exact value. Kendall's tau is 0.929 with exact p = .0004 in both programs. (6) "Daily visitors and loans were strongly correlated, r(6) = .99, p < .001, 95% CI [.93, 1.00], n = 8 days." The correlation says busy days are high-loan days; it does not say how many extra loans one extra visitor brings (that needs a regression slope), and with 8 days it says nothing about unusual days outside the observed range.

Self-test.

  1. Influence (a high-leverage point). Check the point against the source, report r with and without it, show the scatter, and consider Spearman (here 0.02 with the point).
  2. The sampling distribution of r is bounded by 1 and skewed when ρ\rho is far from 0, so the CI is computed on the Fisher z scale (where it is symmetric) and transformed back, which stretches the side towards 0: [0.52, 0.94].
  3. Restriction of range: admitted students all scored high on the test, so the spread of X is small and r shrinks.
  4. Test the difference between the two correlations directly with Fisher's z test for independent samples (or an interaction term in a regression). "Significant versus not significant" is not itself a significant difference.
  5. Kendall's tau-b: it handles ties well, is designed for ordinal data and has good small-sample behaviour. Spearman is also acceptable; Pearson is not, because the item is ordinal.
  6. (a) Study organisation affects both sleep and scores (confounding), and sleep also has a smaller direct effect on scores. (b) Sleep improves concentration, which allows more effective study, which raises scores: then study hours are partly a mediator, and controlling for them removes part of a real effect of sleep. The data alone cannot tell these stories apart; a design or prior knowledge must.

Revision history

VersionDateAuthorChange summary
0.1YYYY-MM-DD[Your name]First draft from the template
0.2YYYY-MM-DD[Your name]Example: Replaced Lakemoor example with thesis questionnaire data; partial correlation added

관련 템플릿