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
Cómo usar: 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.
Vista previa
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
| Field | Value |
|---|---|
| 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 versions | R 4.5.1 (stats); Python 3.14 with numpy 2.5.4, pandas 3.1.0, scipy 1.18.1, statsmodels 0.15.0 |
| Date | YYYY-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 when | Do not use when |
|---|---|
| Two quantitative or ordinal variables measured on the same units | One variable is nominal with more than two categories (use group comparisons or Cramér's V) |
| You want a symmetric measure of association | You 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 pairs | Repeated measures on the same people are pooled (use repeated-measures correlation or a mixed model) |
| You want to describe, then perhaps test, an association | You 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.
| Student | Sleep (h) | Study (h/week) | Quiz (/20) | Student | Sleep (h) | Study (h/week) | Quiz (/20) | |
|---|---|---|---|---|---|---|---|---|
| 1 | 5.5 | 3 | 11 | 9 | 8.4 | 7 | 17 | |
| 2 | 6.0 | 6 | 13 | 10 | 5.1 | 3 | 12 | |
| 3 | 6.5 | 4 | 12 | 11 | 6.8 | 4 | 14 | |
| 4 | 7.0 | 5 | 15 | 12 | 6.6 | 6 | 13 | |
| 5 | 7.5 | 7 | 16 | 13 | 7.7 | 5 | 14 | |
| 6 | 8.0 | 6 | 14 | 14 | 7.9 | 8 | 18 | |
| 7 | 6.2 | 2 | 10 | 15 | 5.8 | 4 | 11 | |
| 8 | 7.1 | 8 | 15 |
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
| Assumption | Check | R | Python | If violated |
|---|---|---|---|---|
| Independent pairs (one row per unit) | Design: no repeated measures, no clusters | n/a | n/a | Repeated-measures correlation, mixed model, or one value per unit |
| Linear relation (Pearson) | Scatter plot; add a smoother | plot(x, y); lines(lowess(x, y)) | plt.scatter(x, y) | Spearman or Kendall for monotonic; transform; regression with a curve |
| No single point dominating | Scatter; r with and without each point | cor(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 CI | Q-Q plots of each variable; look for skew and outliers | qqnorm(x) | stats.probplot(x, plot=plt) | Spearman or Kendall; bootstrap CI |
| Full range of both variables sampled | Compare observed range with the population range | range(x) | x.min(), x.max() | Report the restriction; do not generalise beyond the range |
| Ties (rank methods) | Count repeated values | sum(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. is the proportion of the variance of Y that a straight line in X accounts for (and vice versa).
Test of , with df :
Spearman's rho is Pearson's formula applied to the ranks and . Without ties it simplifies to
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 concordant and discordant pairs and no ties, . 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 , so the CI is built on a transformed scale where it is close to normal, then transformed back:
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):
Correlations from the same sample that share a variable (for example and ) 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,
Each extra control variable removes one more degree of freedom.
| Symbol | Meaning |
|---|---|
| Sample size (number of pairs) | |
| , | Sample and population Pearson correlation |
| Spearman's rank correlation (rho) | |
| Kendall's tau (tau-b with ties) | |
| z-score of , using with divisor | |
| Fisher-transformed correlation | |
| Standard error on the Fisher scale | |
| Partial correlation of X and Y controlling for Z | |
| Numbers of concordant and discordant pairs | |
| df | Degrees 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. ; ; , 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. , df = 13, matching R's t = 5.032.
Step 5. By hand: the Fisher CI. ; ; ; 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. : 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: .
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 = .84). Controlling for weekly study hours, the partial correlation was smaller, = .56, t(12) = 2.35, p = .037."
Where R and Python differ by design.
| Point | R cor.test | SciPy | Note |
|---|---|---|---|
| Pearson CI | Fisher z, shown by default | pearsonr(...).confidence_interval() (Fisher z) | Same numbers |
| Spearman p with ties | Asymptotic t approximation, warning "Cannot compute exact p-value with ties" | spearmanr always uses the t approximation | Same here (p = 0.000095) |
| Spearman p without ties | Algorithm AS 89 by default (n up to about 1290): exact permutation p for n < 10, an Edgeworth series approximation for larger n | spearmanr 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 |
| Kendall | tau-b; exact p when no ties and n < 50, else normal approximation | tau-b; method="auto" picks exact when there are no ties and n is 33 or less | Same here (normal approximation because of ties) |
| Partial correlation | No base function; residual method (or the ppcor package) | No function in scipy or statsmodels; residual method | Same 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.
- Fisher transform: [ ].
- Standard error: [ ].
- CI on the z scale: [ , ].
- Back-transform with tanh: 95% CI for = [ , ].
- Test of : [ ], df = [ ], p = .027.
- Compare with the first cohort (r = 0.813, n = 15): , 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:
| Day | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 |
|---|---|---|---|---|---|---|---|---|
| Visitors | 120 | 135 | 150 | 160 | 180 | 200 | 210 | 240 |
| Loans | 48 | 50 | 61 | 58 | 70 | 75 | 83 | 90 |
- Draw the scatter plot. Is Pearson appropriate?
- Compute r (use software for the sums) and the t statistic with its df.
- Compute the 95% CI with Fisher's z.
- Compute Spearman's rho from the rank differences by hand (there are no ties).
- Run
cor.test(..., method = "spearman")in R andstats.spearmanrin Python. Why are the p-values different? - Write an APA-style sentence, and one sentence on what the correlation does and does not tell the library manager.
Reading software output
| Output line | Meaning | Report it? |
|---|---|---|
t = 5.032, df = 13 | Test statistic for , df | Report df in brackets: r(13) |
p-value = 0.0002296 | Two-sided p-value | Yes, as p < .001 |
95 percent confidence interval: 0.515 0.936 | Fisher z interval for | Yes, always |
cor 0.8128732 | Sample Pearson r | Yes, two decimals, no leading zero in APA style |
S = 90.635 (Spearman) | Sum of squared rank differences statistic | No; report rho and p |
z = 3.3972 (Kendall) | Normal approximation statistic | Optional |
Cannot compute exact p-value with ties | Ties present, so an approximation is used | Mention ties if p is borderline |
partial_r 0.5614, df 12 | Partial correlation and its df | Yes, 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 = [.xx] gave the same conclusion.] [Controlling for [Z], the partial correlation was [.xx], t([n - 3]) = [ ], p = [ ].]"
| Pair | n | r | 95% CI | p | Spearman | Note |
|---|---|---|---|---|---|---|
| Example: sleep, quiz | 15 | .81 | [.52, .94] | < .001 | .84 | Partial r given study = .56 |
| Example: sleep, study | 15 | .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 statement | Correct 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." | = 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
- 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?
- Why is the 95% CI for r = 0.81 with n = 15 not symmetric around 0.81?
- 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?
- 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?
- For ordinal data (a 5-point satisfaction item) and a small sample with many ties, which coefficient would you choose, and why?
- 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
| Item | Entry |
|---|---|
| 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 dates | YYYY-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(); SciPystats.pearsonr(),stats.spearmanr(),stats.kendalltau().
Answer key
Worked example B. (1) . (2) . (3) . (4) gives 95% CI [0.04, 0.60]. (5) , 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, , df = 6, p < .001. (3) , , 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; = 0, 0, -1, 1, 0, 0, 0, 0; ;
. (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.
- 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).
- The sampling distribution of r is bounded by 1 and skewed when 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].
- Restriction of range: admitted students all scored high on the test, so the spread of X is small and r shrinks.
- 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.
- 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.
- (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
| Version | Date | Author | Change summary |
|---|---|---|---|
| 0.1 | YYYY-MM-DD | [Your name] | First draft from the template |
| 0.2 | YYYY-MM-DD | [Your name] | Example: Replaced Lakemoor example with thesis questionnaire data; partial correlation added |
Plantillas relacionadas
Statistical Analysis Plan Template (Statistics, Thesis or Project)
Statistical analysis plan for a thesis or project: estimands, hypotheses, sample size, primary model, pre-set assumption fallbacks, missing data, multiplicity, sensitivity, deviations log
AcadémicasStatistical Analysis Report Template (Statistics, Thesis or Client)
Complete statistical analysis report for a thesis results chapter or client: plain-language summary, methods, descriptives, main analyses, assumption checks, sensitivity, limitations, reproducibility appendix, reviewer checklist
AcadémicasANCOVA Method Card Template (Statistics, R and Python)
Analysis of covariance: covariate adjustment, homogeneity of slopes, adjusted means by hand and with emmeans, ANCOVA vs change scores, Lord's paradox, reporting