Correlation Coefficient Calculator

Calculate Pearson's r correlation coefficient between two variables. Measure the strength and direction of a linear relationship. Values range from -1 (perfect negative) to +1 (perfect positive).

📊 Statistics📐 r = Σ[(x-x̄)(y-ȳ)] / (n⋅sx⋅sy)🔢 Math
Enter x values (comma-separated)
Enter y values (comma-separated)
Please enter valid values.

Formula & Reference

VariableSymbolFormulaUnits
Correlation Coefficient Calculatorr = Σ[(x-x̄)(y-ȳ)] / (n⋅sx⋅sy)dimensionless -1 to 1

Step-by-Step Examples

Example 1
Height vs Weight

x: 160,165,170,175,180 (cm). y: 55,60,65,70,80 (kg).

  • Calculate means: x̄=170, ȳ=66
  • Numerator: Σ(xi-x̄)(yi-ȳ) = (-10)(-11)+(-5)(-6)+(0)(-1)+(5)(4)+(10)(14)
  • = 110+30+0+20+140 = 300
  • r = 300 / sqrt(250×394) = 300/313.8 = 0.956
✓ r = 0.956 — very strong positive correlation
Example 2
Temperature vs Ice Cream Sales

Temp: 10,15,20,25,30. Sales: 20,30,40,50,70.

  • Positive relationship: higher temp → more sales
  • r ≈ 0.989
  • Strong positive correlation
✓ r = 0.989 — very strong
Example 3
No Correlation

x: 1,2,3,4,5. y: 5,1,4,2,3 (random).

  • Positive and negative deviations cancel out
  • r ≈ -0.20
  • Very weak, near-zero correlation
  • No linear relationship
✓ r ≈ -0.20 — very weak, essentially no correlation

Real-World Applications

Common Mistakes to Avoid

⚠️
Correlation does not imply causation

r = 0.95 between X and Y means they move together linearly. It does NOT mean X causes Y. Always consider confounding variables and mechanism.

⚠️
Pearson r only measures LINEAR relationships

Two variables can have r = 0 but a perfect nonlinear relationship (e.g., U-shaped). Always plot your data first.

⚠️
Outliers can drastically change r

A single outlier can inflate r from 0.2 to 0.9 or deflate it from 0.9 to 0.3. Visualize data and check outliers before reporting r.

Frequently Asked Questions

What does r = 0.7 mean?
A strong positive linear correlation. About 49% of variance in y is explained by x (r² = 0.49). When x increases, y tends to increase. But not all data falls exactly on a line.
What is r²?
The coefficient of determination. r² × 100% = percentage of variance in y explained by the linear relationship with x. r=0.8 → r²=0.64 → 64% of y variance is explained.
When should I use Spearman instead?
Spearman rank correlation: for ordinal data, non-normal distributions, or when relationship is monotonic but not linear. More robust to outliers than Pearson r.
What is a correlation matrix?
A table showing pairwise correlations between all variables in a dataset. Used in feature selection, multicollinearity checks in regression, and portfolio analysis.
What is statistical significance of r?
Test r with t = r√(n-2)/√(1-r²), df=n-2. For n=20 and r=0.5: t = 2.31, p ≈ 0.03 (significant). Small r can be significant with large n, but may not be practically meaningful.

Related Math Calculators

Formula Explorer connections

Interpretation: This formula summarizes data, models uncertainty or supports inference about a population or random process. Assumption: The sampling design and distribution assumptions must match the data. Independence, sample size, outliers and measurement quality can materially affect interpretation.

Expected Value Calculator →Hypothesis Testing Calculator →Interquartile Range (IQR) Calculator →Math Formula Explorer →