Correlation Calculator

Calculate the Pearson correlation coefficient (r) between two data sets to measure the strength and direction of their linear relationship.

CORRELATION COEFFICIENT (r)
--
R-Squared
--
Strength
--
Mean X
--
Mean Y
--

What Is Correlation?

The Pearson correlation coefficient (r) measures the strength and direction of the linear relationship between two continuous variables. It ranges from -1 (perfect negative) to +1 (perfect positive), with 0 indicating no linear relationship. It is one of the most widely used statistical measures in research, analytics, and data science.

Correlation helps identify whether changes in one variable are associated with changes in another. It forms the basis for regression analysis and predictive modeling. However, it only captures linear relationships and can miss non-linear patterns entirely.

Pearson Formula

r = Σ(xi - x̄)(yi - ȳ) / √[Σ(xi - x̄)² × Σ(yi - ȳ)²]

Interpreting r

|r| RangeStrengthExample
0.9 - 1.0Very StrongHeight and weight
0.7 - 0.9StrongStudy hours vs scores
0.5 - 0.7ModerateIncome vs happiness
0.3 - 0.5WeakCoffee vs productivity
0.0 - 0.3Very WeakShoe size vs IQ

Correlation vs Causation

A strong correlation does not imply causation. Ice cream sales and drowning deaths are positively correlated because both increase in hot weather. Always consider confounding variables and use experimental designs to establish causation.

Frequently Asked Questions

What is R-squared?

R-squared (r²) is the proportion of variance in Y explained by the linear relationship with X. An r² of 0.85 means 85% of Y variability is explained by X.

When should I use Spearman instead?

Use Spearman rank correlation for ordinal data, non-normal distributions, or monotonic non-linear relationships. It measures whether ranks move together rather than raw values.

Can r be 0 even if data is related?

Yes. Pearson r only measures linear relationships. A perfect quadratic or circular pattern can give r = 0. Always plot your data before interpreting correlation coefficients.