Correlation Coefficient

Statistics & Probability

The correlation coefficient (r) is a number between -1 and 1 that quantifies the strength and direction of the linear relationship between two variables.

Formula

r = \dfrac{\sum (x_i-\bar{x})(y_i-\bar{y})}{\sqrt{\sum (x_i-\bar{x})^2 \sum (y_i-\bar{y})^2}}

Definition

The correlation coefficient is a number from -1 to +1 that measures how strongly two variables are related: a value near +1 means a strong positive relationship, near -1 means a strong negative relationship, and near 0 means little relationship. The Pearson correlation coefficient $r$ measures the strength and direction of the linear relationship between two quantitative variables, and the value $r^2$ (coefficient of determination) tells the proportion of variance in $y$ explained by $x$. Formally, $r = \text{Cov}(X,Y)/(s_X s_Y)$, computed from sample data; under $H_0: \rho = 0$, the statistic $t = r\sqrt{n-2}/\sqrt{1-r^2} \sim t(n-2)$, and Fisher's z-transformation $z = 0.5\ln\left(\frac{1+r}{1-r}\right)$ transforms $r$ to an approximately normal statistic, enabling confidence intervals for $\rho$.

Example

$r = 0.9$ means a very strong positive relationship (almost a straight line going up); $r = -0.6$ means a moderate negative relationship; $r = 0.1$ means almost no relationship. For study hours ($x$) and test scores ($y$) with $10$ students, if $r = 0.85$, then $r^2 = 0.72$: study hours explain $72\%$ of the variation in test scores. Fisher's z-interval for $\rho$ is $z_r \pm z_{\alpha/2}/\sqrt{n-3}$, then back-transformed; for $r=0.7$, $n=50$: $z_r = 0.867$, giving a $95\%$ CI in z-space of $0.867 \pm 1.96/\sqrt{47} = (0.581, 1.153)$, which back-transforms to $\rho$ in $(0.524, 0.818)$.

Key Insight

Think of the correlation coefficient as a "relationship score": the closer to 1 or -1, the tighter the relationship, the closer to 0, the weaker; a common interpretation is $|r| < 0.3$ is weak, $0.3$-$0.7$ is moderate, and $> 0.7$ is strong, though these thresholds are context-dependent. The correlation coefficient is sensitive to outliers and captures only linear relationships; Spearman's rank correlation $r_s$ and Kendall's tau are nonparametric alternatives that measure monotone relationships and are more robust to outliers and nonnormality.