Skip to content
AZ Tools

Pearson, Spearman & Kendall Correlation

Pearson's r with a p-value and Fisher-z interval, Spearman's ρ and Kendall's τ-b from pasted pairs — with a warning when values and ranks disagree.

CoefficientValuep-value95% interval
Pearson r0.57120.1082[-0.1497, 0.8956]
Spearman ρ0.60.08762—
Kendall τ-b0.44440.1194—

n = 9 · r² = 0.3262 · Kendall's p is exact (no ties, fewer than 50 pairs).

Scatter plot

Calculated in the browser. The pairs are kept in local storage.

How to use

  1. Paste one pair per line, x then y — or two columns straight from a spreadsheet.
  2. Choose a two-sided test, or a one-sided one if you are only asking about a positive or a negative association.
  3. Read Pearson's r with its interval, then compare it with Spearman's ρ and Kendall's τ.
  4. If the tool warns that r and ρ disagree, look at the scatter plot for an outlier or a curve.
  5. Load Anscombe's quartet III to see a single point change r while leaving the ranks almost untouched.

About this tool

Show

Paste pairs of numbers and get three correlation coefficients side by side, each with a p-value: Pearson's r with a confidence interval from Fisher's z transformation, Spearman's rank correlation ρ, and Kendall's τ-b. The first example is the one R's own cor.test documentation uses, from Hollander and Wolfe, and the tool reproduces R's printout to the digit — r = 0.5711816, p = 0.1082, a 95% interval from −0.1497 to 0.8956, and a one-sided Kendall p of 0.05972. The second is the third set of Anscombe's 1973 quartet, which exists to make one point: its Pearson r is 0.816, the same as the three other sets, but ten of its eleven points lie on an almost perfect line and one outlier drags r down. Spearman's ρ, which only sees the order of the values, comes out at 0.991. When r and ρ differ by more than 0.15 the tool says so and points at the scatter plot, because that gap almost always means an outlier or a curved relationship that r is summarising badly. Kendall's p is exact when there are no ties and fewer than fifty pairs — the rule R uses — computed from the distribution of inversions in a random permutation; otherwise it uses the normal approximation with the variance corrected for ties, and the note says which. Spearman's p uses the t approximation, as scipy does. None of these coefficients says anything about cause, and none of them detects a relationship that is not monotonic: y = x² over a range symmetric around zero has a correlation near zero by every measure here. For the fitted line itself, use the linear regression tool.

Frequently asked questions

Which coefficient should I report?

Pearson's r when the relationship looks linear and there are no strong outliers; it measures how well a straight line fits. Spearman's ρ when you care about any monotonic relationship or the data are skewed or ordinal. Kendall's τ when samples are small or have many ties — its value is smaller than ρ for the same data but its p-value and interpretation, the probability that a random pair is ordered the same way on both variables minus the probability it is not, are more robust.

Why are Pearson and Spearman so different on my data?

Because they answer different questions. Pearson uses the values, so a single extreme point can pull it a long way; Spearman uses only ranks, so the same point counts no more than any other. A curved but steadily increasing relationship also gives a high ρ and a lower r. A large gap is a signal to look at the plot before choosing.

How is the confidence interval for r computed?

Through Fisher's z transformation: atanh(r) is close to normally distributed with standard error 1/√(n − 3), so the interval is built there and transformed back with tanh. That is why it is asymmetric around r and never passes ±1. It needs at least four pairs, and for a one-sided alternative it is one-sided too.

When is Kendall's p-value exact?

When neither variable has ties and there are fewer than fifty pairs, the rule R's cor.test follows. The exact distribution comes from counting how many permutations of n items have each number of inversions. With ties or more pairs, the normal approximation with the tie-corrected variance is used, matching scipy's asymptotic method.

Does a significant correlation mean one variable causes the other?

No. A correlation can come from a common cause, from reverse causation, from how the sample was selected, or from chance across many comparisons. And a correlation of zero does not mean independence: these coefficients only detect relationships that go consistently one way, so a U-shaped pattern can score near zero.

Related tools