Correlation Coefficient Calculator
Correlation Coefficient Calculator
The Pearson correlation coefficient is one of the most widely used statistics in data science, measuring the strength and direction of a linear relationship between two numeric variables.
r = Σ((x - x̄)(y - ȳ)) / √(Σ(x - x̄)² x Σ(y - ȳ)²)
Example
X values: 1, 2, 3, 4, 5. Y values: 2, 4, 5, 4, 5.
r ≈ 0.77 - a strong positive correlation.
Reading the Coefficient
| r range | Strength |
|---|---|
| 0.7 to 1.0 | Strong positive |
| 0.3 to 0.7 | Moderate positive |
| -0.3 to 0.3 | Weak or no correlation |
| -0.7 to -0.3 | Moderate negative |
| -1.0 to -0.7 | Strong negative |
An Important Limitation
Pearson correlation only detects linear relationships - two variables can have a very strong non-linear relationship (like a perfect U-shape or a sine wave pattern) and still produce a correlation coefficient near zero, since the pattern isn't a straight line. This is a foundational check in exploratory data analysis and feature selection, but it should never be treated as a complete picture of how two variables relate to each other.