Skip to content
MasterMath

Pearson Correlation Calculator

Pearson's correlation coefficient measures the strength and direction of the linear relationship between two variables, on a scale from −1 to 1, with its p-value.

Pearson coefficient

—

Pearson coefficient—
R squared—
Strength of the relationship—
p-value—
Pairs of values—
Covariance—
#XYPredicted Y

How this was worked out

    The formula

    r = Σ(x − x̄)(y − ȳ) / √( Σ(x − x̄)² · Σ(y − ȳ)² )

    What it means

    Pearson normalises the covariance by dividing it by the product of the two deviations, and that leaves the result free of units and always between −1 and 1. A 1 is a perfect rising line, a −1 a perfect falling one, and a 0 means there is no linear relationship. Its square, R², is the share of one variable's variation that the other one explains.

    How to work it out by hand

    1. Work out the mean of each variable
    2. For each pair, multiply the deviation of x by the deviation of y, and add them up
    3. Divide by the root of the product of each variable's sum of squares
    4. The answer lies between −1 and 1: that is the coefficient

    What is worth knowing

    Pearson only sees linear relationships. A perfect parabola can give a correlation of zero, and that does not mean there is no relationship: it means it is not a straight line. So look at the scatter before you look at the number. And the usual warning: correlation is not cause. Two variables may correlate because one causes the other, because both depend on a third, or by sheer coincidence, and the coefficient cannot tell those three apart.

    Frequently asked questions

    What counts as a strong correlation?

    Above 0.7 in absolute value is usually called strong, 0.3 to 0.7 moderate and below that weak. It depends heavily on the field.

    Does correlation imply causation?

    No. There may be a common cause, reverse causation or coincidence. The coefficient cannot distinguish those cases.

    What is R squared?

    The share of one variable's variation explained by the other. An r of 0.8 gives an R² of 0.64: 64 %.

    Does it detect any relationship?

    Only linear ones. A U-shaped relationship can give an r near zero even when the relationship is perfect.

    Do outliers affect it?

    A great deal. A single distant point can change the coefficient drastically, in either direction.