Correlation Coefficient
Statistics & ProbabilityThe 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 strong positive relationship; near -1 means strong negative relationship; near 0 means little relationship.
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.
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.
Definition
The Pearson correlation coefficient $r$ measures the strength and direction of the linear relationship between two quantitative variables. It equals the sum of the products of the standardized scores divided by $n-1$. The value $r^2$ (coefficient of determination) tells the proportion of variance in $y$ explained by $x$.
Example
For study hours ($x$) and test scores ($y$) with $10$ students, computing $r$ step by step: find $\bar{x}$ and $\bar{y}$, compute z-scores for each, multiply paired z-scores, sum them, divide by $n-1$. If $r = 0.85$, then $r^2 = 0.72$: study hours explain $72\%$ of the variation in test scores.
Key Insight
Interpreting $r$: $|r| < 0.3$ is weak, $0.3$-$0.7$ is moderate, $> 0.7$ is strong. These thresholds are context-dependent; in physical sciences, $r = 0.7$ might be considered weak, while in social sciences it might be strong.
Definition
The Pearson $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)$. 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$ and tests of $H_0: \rho = \rho_0$.
Example
Fisher's z-interval for $\rho$: $z_r \pm z_{\alpha/2}/\sqrt{n-3}$, then back-transform. For $r=0.7$, $n=50$: $z_r = 0.867$. $95\%$ CI in z-space: $0.867 \pm 1.96/\sqrt{47} = (0.581, 1.153)$. Back-transformed: $\rho$ in $(0.524, 0.818)$.
Key Insight
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.