Correlation
Pearson r
Ranges from −1 (perfect negative) to +1 (perfect positive).
Spearman ρ
Rank-based correlation; robust to outliers and monotone non-linear relationships.
Correlation vs Causation
A high r does not imply causation. Confounding variables can produce spurious correlations.
Examples
Example 1. x=[1,2,3], y=[2,4,6]. Compute r.
Solution. Perfect linear relationship, r = 1.
Background
Correlation measures the strength and direction of a linear relationship between two variables. The Pearson correlation coefficient \(r\) ranges from −1 (perfect negative linear relationship) to +1 (perfect positive linear relationship), with 0 indicating no linear association. It is dimensionless and unaffected by linear rescaling of either variable.
A crucial warning: correlation does not imply causation. Two variables can be strongly correlated because one causes the other, because both are caused by a third variable (confounding), or purely by chance (spurious correlation). Always consider the data-generating process before interpreting \(r\).
The Spearman rank correlation \(\rho\) replaces values with their ranks before computing Pearson's \(r\). It detects any monotone relationship (not just linear) and is robust to outliers. Kendall's \(\tau\) is another rank-based measure, preferred for small samples or many ties.
Testing whether \(r\) is significantly different from zero uses the t-statistic \(t=r\sqrt{n-2}/\sqrt{1-r^2}\) with \(n-2\) degrees of freedom. A significant result means the linear association is unlikely to be due to chance alone, but the effect size (\(r^2\), the proportion of shared variance) determines practical importance.
Further Reading & Context
The study of correlation connects to many areas of mathematics and its applications. Understanding the foundational definitions and theorems provides the basis for advanced work in analysis, algebra, and applied mathematics.
Historical development: most mathematical concepts evolved over centuries, with contributions from mathematicians across many cultures. The modern axiomatic treatment provides rigor, while computational tools enable practical application.
In modern mathematics, this topic appears in graduate courses and research across pure and applied mathematics. Connections to computer science, physics, and engineering make it a versatile and important area of study. Mastery of the core results and techniques opens doors to research in number theory, analysis, geometry, and beyond.
Recommended next steps: work through the standard theorems with full proofs, explore the connections to related topics listed above, and practice with a variety of problems ranging from computational exercises to theoretical proofs. The interplay between different areas of mathematics is one of the subject's greatest rewards.
Deep Dive: Correlation
This lesson extends core ideas for correlation with rigorous reasoning, edge-case checks, and application framing in statistics.
Practice Set
Practice. Derive one main result on this page and validate with a numeric or geometric check.
Goal. Confirm assumptions, transformation steps, and final interpretation.
References & Editorial Notes
- Stewart, Calculus.
- Strang, Introduction to Linear Algebra.
- Apostol, Mathematical Analysis.
Last editorial review: 2026-04-14.