Enter your x and y values to measure how closely they follow a straight line.
Numbers separated by commas, spaces or new lines.
One y for each x, in the same order.
Try
Result
You enteredx={1,2,3,4,5}y={2,4,5,4,5}
r=0.774597
r²
0.6
Exact
515
Strength
strongpositive
Show the work
1
Means of x and y
Each value is measured from the mean of its own variable, so the means come first. There are n=5 pairs.
xˉ=515=3yˉ=520=4
2
Sums of squares and products
Sxx measures how spread out the x values are, Syy how spread out the y values are, and Sxy how x and y move together: it is positive when they rise together and negative when one rises as the other falls.
Dividing the shared movement by the geometric mean of the two spreads makes r a pure number between -1 and 1, whatever the units of x and y.
r=SxxSyySxy=10×66=606≈0.774597
4
Strength of a correlation
The sign of r gives the direction and its size the strength: ∣r∣ of at least 0.7 is strong, at least 0.4 moderate, at least 0.1 weak, and below that there is no linear correlation. Here ∣r∣≈0.774597, which is strong positive.
5
Result
So r≈0.774597, which means a strong positive linear correlation.