Correlation
Correlation measures the strength and direction of the linear relationship between two quantitative variables.
Definition
Correlation describes how two things are related: if they tend to increase together, the correlation is positive; if one increases while the other decreases, it is negative; if there is no pattern, it is close to zero. It is a statistical measure of the strength and direction of the linear relationship between two quantitative variables, ranging from -1 (perfect negative linear relationship) to +1 (perfect positive linear relationship), with 0 indicating no linear relationship, and it does not measure nonlinear associations. Formally, the Pearson correlation $\rho = \text{Cov}(X,Y)/(\sigma_X\sigma_Y) = E[(X-\mu_X)(Y-\mu_Y)]/(\sigma_X\sigma_Y)$ is the population correlation, estimated by the sample Pearson $r$; Spearman's rank correlation and Kendall's tau are nonparametric alternatives that measure monotone (not just linear) associations.
Example
Temperature and ice cream sales are positively correlated (hotter days tend to have higher sales), while temperature and hot chocolate sales are negatively correlated (colder days have higher sales). Study hours and GPA have a moderate positive correlation ($r \approx 0.5$-$0.7$), while shoe size and intelligence have approximately zero correlation. Testing $H_0: \rho = 0$ uses the statistic $t = r\sqrt{n-2}/\sqrt{1-r^2}$, which follows a t-distribution with $n-2$ degrees of freedom under the null; for $n=30$ and $r=0.4$, $t = 0.4\sqrt{28}/\sqrt{0.84} = 2.31$, significant at $\alpha=0.05$.
Key Insight
Correlation only measures the relationship, not what causes what: two things can be correlated by accident or because they are both caused by a third factor, like ice cream sales and drowning rates, which both rise in summer without one causing the other. Correlation is invariant under linear transformations of $X$ and $Y$ but not under nonlinear transformations, and two variables with identical Pearson $r$ can have very different scatter plot shapes (see Anscombe's quartet), reinforcing the need for visual inspection alongside numerical summaries.