SOLVETUTORMATH SOLVER

Instrument MI-07-046 · Statistics

Correlation Coefficient Calculator

Two variables that tend to rise and fall together aren't just eyeballed — they're measured. Enter your paired x and y values and this returns Pearson's r, the standard number for how tightly they track a straight line.

Instrument MI-07-046
Sheet 1 OF 1
Rev A
Verified
Type 07 — Regression & Correlation SER. 2026-07046

Pearson correlation coefficient (r)

0.77459667

r = Sxy / sqrt(Sxx * Syy)

0.60000000 r-squared
5 Number of pairs
The working Every figure verified twice
  1. n=5 -> r=0.774597, r^2=0.600000
Worksheet log
  1. No entries yet — change an input to log a scenario.

How this instrument works

Pearson's correlation coefficient, r, measures how closely two paired variables track a straight-line relationship, on a scale from −1 to +1. An r near +1 means that as x increases, y reliably increases too, in a close-to-linear way; an r near −1 means the opposite, x increasing while y reliably decreases; an r near 0 means there's little to no linear relationship between them, though a strong non-linear pattern could still exist underneath a near-zero r.

The formula compares how x and y vary together (their covariance-like cross term, Sxy) against how much each varies on its own (Sxx and Syy individually). Each pair's x-value and y-value are first measured as deviations from their own variable's mean; multiplying those two deviations together and summing across all pairs gives Sxy, which is positive when x and y tend to deviate from their means in the same direction and negative when they tend to move oppositely. Dividing that cross term by the square root of Sxx times Syy rescales it into the fixed −1-to-+1 range that makes r comparable across any two variables, regardless of their original units.

r-squared, reported alongside r, is simply r multiplied by itself — and it has a separate, useful interpretation of its own: the fraction of one variable's variation that a straight-line relationship with the other explains. An r of 0.77 corresponds to an r² of about 0.6, meaning roughly 60% of the variation is captured by the linear relationship between the two variables, leaving the rest to scatter, noise, or a genuinely non-linear pattern this measure doesn't capture. Correlation on its own never establishes that one variable causes the other — it only measures how closely they move together.

r=(xixˉ)(yiyˉ)(xixˉ)2(yiyˉ)2r = \frac{\sum(x_i-\bar{x})(y_i-\bar{y})}{\sqrt{\sum(x_i-\bar{x})^2\sum(y_i-\bar{y})^2}}
x̄, ȳ — the means of the x and y series · Sxy — the sum of paired deviation products, positive when x and y move together, negative when they move oppositely · Sxx, Syy — the sum of squared deviations within each series alone · r — Pearson's correlation coefficient, −1 to +1 · r² — the fraction of variation explained by the linear relationship.
  • Enter your first variable's values into x values, separated by commas, spaces, or new lines.
  • Enter the paired second variable's values, in matching order, into y values.
  • Both series need the same count of entries and at least 2 pairs for a correlation to be computed.
  • Read Pearson correlation coefficient (r) for the −1-to-+1 measure of linear association, and r-squared for the fraction of variation it explains.
  • A value of r close to 0 does not rule out a relationship — it only rules out a linear one; a strong curved pattern can still produce a near-zero r.

Worked example — five paired x, y observations

A data set pairs x = 1, 2, 3, 4, 5 with y = 2, 4, 5, 4, 5. Entering both series, the instrument finds x̄ = 3 and ȳ = 4, then computes each pair's deviations: dx = −2, −1, 0, 1, 2 and dy = −2, 0, 1, 0, 1. Multiplying matching pairs and summing gives Sxy = 4+0+0+0+2 = 6; squaring and summing dx alone gives Sxx = 4+1+0+1+4 = 10; squaring and summing dy alone gives Syy = 4+0+1+0+1 = 6.

Pearson correlation coefficient (r) then reads 0.77459667, computed as 6/√(10×6) = 6/√60. r-squared reads exactly 0.6 — about 60% of the variation in y is explained by its roughly linear relationship with x, a fairly strong positive association even though the five points don't sit on a perfectly straight line (unlike the extreme case of r = 1 or r = −1, where every point lies exactly on one).

Questions

Does a strong correlation mean one variable causes the other?

No — this is one of the most important limits of correlation. A high r only says the two variables tend to move together in a straight-line pattern; it says nothing about why. Both could be driven by a shared third factor, the relationship could run in the opposite direction from what's assumed, or the pattern could simply be coincidence in a small sample. Establishing causation needs additional evidence beyond correlation alone, typically a controlled experiment or a much more careful causal analysis.

What does r = 0 actually tell you?

It tells you there's no linear relationship between the two variables — but it does not rule out a relationship entirely. A perfectly symmetric U-shaped or curved pattern, for instance, can produce an r extremely close to 0 even though x and y are very tightly related, just not in a straight-line way. Always look at a scatter plot of the actual data alongside r, not r in isolation, to catch relationships a linear measure can miss.

What's the difference between correlation and covariance?

They measure the same underlying idea — whether two variables move together — but on different scales. Covariance (this site's separate covariance calculator) keeps the original units of x and y, which makes its raw value hard to compare across different variable pairs. Correlation rescales that same cross-term by each variable's own spread, producing the fixed −1-to-+1 r that's comparable no matter what units x and y were originally measured in.

How large does |r| need to be to call the relationship 'strong'?

There's no single universal cutoff, but common rough guidelines treat |r| below about 0.3 as weak, 0.3 to 0.7 as moderate, and above 0.7 as strong — with the important caveat that what counts as a meaningfully strong relationship varies a lot by field. A modest r can still be practically important in noisy real-world data (like some social-science or medical measurements), while the same r might be considered weak in a field where near-perfect relationships are the norm, like controlled physics measurements.

Can r be exactly 1 or −1 without the data being a perfectly straight line?

No — r reaches exactly 1 or −1 only when every single point lies precisely on a straight line, with no scatter at all around it. Any deviation from a perfectly straight relationship, however small, pulls |r| below 1. This is why the two perfect-line vectors used to validate this calculator's arithmetic (y = 2x+1 and y = 10−2x) come out to r = 1.0 and r = −1.0 exactly, while the everyday five-point example above, with real scatter, lands at a more typical 0.77.

References