TL;DR
Use correlation to measure how strongly two continuous variables move together (no direction implied). Use regression to model how an outcome depends on one or more predictors and to make predictions. Pearson for linear relationships in roughly normal data; Spearman for monotonic relationships or ranked/non-normal data. Finally, correlation does not mean causation.
Correlation
Correlation gives a single number, r, from −1 to +1:
-
Sign = direction (positive: both rise together; negative: one rises as the other falls).
-
Magnitude = strength (0 = no linear association, ±1 = perfect correlation).
-
Pearson's r measures linear association; assumes roughly normal, continuous variables and is sensitive to outliers.
-
Spearman's ρ measures monotonic association using ranks; use it for ordinal data, non-linear-but-monotonic relationships, or when outliers/skew are a concern.
Report r with its CI and p-value. r² (the coefficient of determination) is the proportion of variance in one variable explained by the other: r = 0.7 means r² = 0.49, i.e., about half the variance shared.
Drag the scatter from tight to loose, and switch to the U-shaped data to see Pearson's r collapse to ~0 even with an obvious pattern:
r = 0.86, r² = 0.74, slope = 0.48. Drag tightness toward 100% and r climbs toward 1; loosen it and the same slope comes with a weaker r.
Regression
Linear regression fits y = β0 + β1 x (+ …), estimating how much y changes per unit of x. Unlike correlation, it's directional (you choose predictor and outcome), gives an equation for prediction, and extends naturally to multiple regression (several predictors, adjusting for confounders) and to other outcome types such as:
- Linear regression: continuous outcome.
- Logistic regression: binary outcome.
- Poisson / negative-binomial regression: count outcomes (colonies, reads).
- Cox regression: time-to-event.
Interpret each coefficient as "the change in outcome per one-unit change in that predictor, holding the others constant," and report it with a confidence interval.
Assumptions (linear regression)
Linearity, independence of observations, roughly constant variance of residuals (homoscedasticity), and approximately normal residuals. Check the residual plots, not the raw variables. A curved residual pattern means you need a transformation or a non-linear model.
A biology example
You measure drug dose and cell viability across many wells. A Pearson r of −0.8 says higher dose strongly associates with lower viability. But to predict viability at a new dose, or to ask how much viability drops per µM, you need regression, and if the dose-response is sigmoidal (it usually is), a non-linear (e.g., four-parameter logistic / IC50) model fits better than a straight line.
Correlation ≠ causation
A strong correlation can come from a true causal link, reverse causation, or a confounder driving both variables. Only a controlled, randomized experiment firmly supports a causal claim.
A strong correlation can arise from a true causal link, reverse causation, or a confounder driving both variables. Two famous traps:
- Spurious correlation: unrelated variables that happen to trend together.
- Confounding: batch, age, or sex driving both predictor and outcome. Multiple regression can adjust for measured confounders, but only a controlled experiment (randomization) firmly supports causal claims.
Common mistakes
- Claiming causation from observational correlation.
- Using Pearson on a clearly non-linear or outlier-driven relationship. r can be misleadingly low or high. Always plot the data first.
- Over-interpreting r². Explaining variance isn't the same as a meaningful or causal effect.
- Extrapolating a regression beyond the range of your data.
- Fitting a straight line to dose-response data that needs a sigmoidal model.