Advertisement

r Correlation Calculator

Calculate the Pearson correlation coefficient (r) and R² between two variables. Enter X and Y values as comma-separated lists of equal length and get instant interpretation.

Pearson Correlation Formula

r = [n Σxy − (Σx)(Σy)] / √([n Σx² − (Σx)²] × [n Σy² − (Σy)²])

Where n is the number of pairs, Σxy is the sum of products, Σx and Σy are the sums of each variable. The result r ranges from −1 (perfect negative) to +1 (perfect positive).

How to Calculate Pearson r

  1. 1
    Enter Paired Data
    Each X value corresponds to a Y value at the same position. Both lists must be the same length.
  2. 2
    Compute Sums
    Calculate Σx, Σy, Σx², Σy², and Σxy from your data pairs.
  3. 3
    Apply the Formula
    Substitute sums into the Pearson r formula to get a value between −1 and +1.
  4. 4
    Interpret r and R²
    r tells the direction and strength of the linear relationship. R² tells what proportion of variance in Y is explained by X.

Worked Example

X = 1, 2, 3, 4, 5 — Y = 2, 4, 5, 4, 5

n=5 | Σx=15 | Σy=20 | Σxy=64 | Σx²=55 | Σy²=86
r = [5×64 − 15×20] / √([5×55−15²] × [5×86−20²])
r = [320 − 300] / √([275−225] × [430−400])
r = 20 / √(50 × 30) = 20 / √1500
r = 20 / 38.73 = 0.8165 (strong positive)

Frequently Asked Questions

Correlation measures the strength and direction of a linear relationship between two variables. The Pearson r coefficient ranges from −1 (perfect negative) to +1 (perfect positive), with 0 indicating no linear relationship.

An r of 0.8 indicates a strong positive correlation — as X increases, Y tends to increase substantially. About 64% of the variance in Y is explained by X (R² = 0.64).

Correlation shows that two variables move together, but does not prove one causes the other. A third hidden variable (confound) may drive both. Always be cautious about drawing causal conclusions from correlation alone.

R² is the square of the Pearson r and represents the proportion of variance in one variable explained by the other. An R² of 0.7 means 70% of the variation in Y is accounted for by its linear relationship with X.

Related Calculators