Formula & Calculator
Pearson Correlation Coefficient
Measures the strength and direction of the linear relationship between two variables, standardized to range from -1 to +1.
Interpretation
r = Cov(X,Y) / (σX σY). Measures linear relationship between two variables, ranging from −1 to +1. 0 means no linear relationship. Used in regression and data analysis.
Variables
| Symbol | Quantity | Unit |
|---|---|---|
| r | Pearson correlation coefficient | |
| Cov(X,Y) | Covariance of X and Y | |
| σX | Standard deviation of X | |
| σY | Standard deviation of Y |
What it means
The Pearson correlation coefficient (r) is a standardised measure of the strength and direction of the linear relationship between two variables. It ranges from −1 (perfect negative linear) to +1 (perfect positive linear), with 0 indicating no linear correlation. It is the covariance divided by the product of the standard deviations. Correlation is widely used in data analysis, in finance (diversification), in medicine (association between risk factors), and in psychology. However, correlation does not imply causation. It is also sensitive to outliers. Understanding r is crucial for interpreting scatterplots and for building regression models. The square of r, R², represents the proportion of variance explained.
Worked example
Pearson Correlation – Two Examples
Real‑World| Parameter | Value |
|---|---|
| Cov | 15 |
| σX | 5 |
| σY | 4 |
| Parameter | Value |
|---|---|
| Cov | -10 |
| σX | 3 |
| σY | 4 |
Common mistakes
- Correlation coefficient r: Measures the strength and direction of a linear relationship.
- Range: r is between −1 and +1 inclusive.
- Units: r is dimensionless.
- Causation: Correlation does not imply causation.
- Outliers: Outliers can greatly affect the correlation coefficient.
Applications
The Pearson correlation coefficient (r) measures the strength and direction of a linear relationship between two variables, ranging from −1 to +1. It is one of the most used statistics in all disciplines. Engineers use it to validate simulation models, to assess relationships between input and output variables, and to design experiments. In finance, it diversifies portfolios. In medicine, it correlates risk factors with outcomes. By calculating r, professionals can quantify the degree of association, test hypotheses about relationships, and identify redundant predictors. The correlation coefficient is scale‑independent, making it interpretable across different units. It is a cornerstone of exploratory data analysis and predictive modelling.
- Exploratory data analysis – identifying variable relationships
- Model validation – comparing simulated and measured data
- Finance – diversification and asset correlation
- Medical research – linking risk factors to diseases
- Quality control – process input‑output correlation
Frequently Asked Questions
r = Cov(X,Y) / (σX · σY). It measures the strength and direction of a linear relationship between two variables, ranging from −1 (perfect negative) to +1 (perfect positive).
It indicates a strong positive linear relationship. As X increases, Y tends to increase. The value 0.8 is close to 1, suggesting a strong association.
Correlation does not imply causation. Two variables can be highly correlated without one causing the other (e.g., ice cream sales and drowning incidents both increase in summer).
Outliers can drastically affect Pearson's r. A single extreme point can inflate or deflate the correlation, making it misleading. Always check scatterplots.
- Linear relationship
- Continuous variables
- Approximately normal distributions
- No significant outliers
A t‑test is used: t = r√(n−2) / √(1−r²), with df = n−2. This tests whether the population correlation is zero.
R² = r² for simple linear regression. It represents the proportion of variance in Y explained by X. For r = 0.8, R² = 0.64, meaning 64% of the variance is explained.
It is not suitable for non‑linear relationships; it will underestimate the strength. Spearman's rank correlation is better for monotonic, non‑linear relationships.
The Fisher transformation is z = 0.5 ln((1+r)/(1−r)). It stabilises the variance and is used to construct confidence intervals for correlation coefficients.
Features with high correlation to the target are often selected, while highly correlated features among themselves may be redundant. Correlation matrices help in dimensionality reduction.