Correlation Calculator

Enter equal numbers of X and Y values. Correlation ranges from -1 to +1.


Add this Calculator to Your Site

What is Correlation?

Correlation measures the strength and direction of a linear relationship between two variables. The Pearson correlation coefficient (r) is the most common measure, ranging from -1 to +1.

Pearson Correlation Formula

r = sum((xi - x_mean)(yi - y_mean)) / sqrt(sum((xi - x_mean)^2) * sum((yi - y_mean)^2))

Or equivalently:

r = (n*sum(xy) - sum(x)*sum(y)) / sqrt((n*sum(x^2) - (sum(x))^2) * (n*sum(y^2) - (sum(y))^2))

Interpreting Correlation Values

  • r = 1: Perfect positive correlation
  • 0.7 to 0.99: Strong positive correlation
  • 0.4 to 0.69: Moderate positive correlation
  • 0.1 to 0.39: Weak positive correlation
  • r = 0: No linear correlation
  • -0.1 to -0.39: Weak negative correlation
  • -0.4 to -0.69: Moderate negative correlation
  • -0.7 to -0.99: Strong negative correlation
  • r = -1: Perfect negative correlation

Coefficient of Determination (r squared)

The square of the correlation coefficient (r squared) tells you the proportion of variance in one variable that is explained by the other variable.

r squared = r * r

For example, if r = 0.8, then r squared = 0.64, meaning 64% of the variance in Y can be explained by X.

Example Calculation

For data points: (1,2), (2,4), (3,5), (4,4), (5,5)

X: 1, 2, 3, 4, 5    Y: 2, 4, 5, 4, 5
X mean = 3          Y mean = 4
n = 5

Calculating intermediate values...
sum(xy) = 1*2 + 2*4 + 3*5 + 4*4 + 5*5 = 66
sum(x) = 15, sum(y) = 20
sum(x^2) = 55, sum(y^2) = 86

r = (5*66 - 15*20) / sqrt((5*55 - 225)(5*86 - 400))
r = (330 - 300) / sqrt(50 * 30)
r = 30 / 38.73
r = 0.775

This indicates a strong positive correlation.

Important Notes

  • Correlation does not imply causation: Two variables may be correlated without one causing the other
  • Linear relationships only: Pearson correlation measures linear relationships; non-linear patterns may show low r values
  • Sensitive to outliers: Extreme values can significantly affect the correlation coefficient
  • Sample size matters: Larger samples provide more reliable estimates

Applications of Correlation

Research

Examining relationships between variables in scientific studies.

Finance

Analyzing relationships between stock prices, portfolio diversification.

Psychology

Studying relationships between behavioral variables and outcomes.

Quality Control

Identifying factors that affect product quality.

Other Calculators