Kendall tau correlation calculator
This Kendall tau correlation calculator measures whether two equal-length numeric series tend to move in the same rank order.
Run — free
It examines every pair of observations, counts concordant and discordant relationships, records ties, and returns Kendall's tau-a together with the counts behind the result. Because the calculation is deterministic and distribution-free, it is useful when ranks matter more than distances, when values are not normally distributed, or when a linear Pearson correlation would not describe the relationship you actually want to study.
What Kendall's tau measures
Kendall's tau is a rank association statistic. Instead of asking whether two variables follow a straight line, it asks whether the ordering of observations agrees. For each pair of positions, the calculator compares the direction of change in the first series with the direction of change in the second. A pair is concordant when both values rise together or both fall together. It is discordant when one rises while the other falls. The reported tau-a value subtracts discordant pairs from concordant pairs and divides by the total number of possible observation pairs. The result ranges from minus one to one. A value near one indicates consistently matching order, a value near minus one indicates consistently reversed order, and a value near zero indicates that agreement and disagreement broadly balance. This interpretation concerns monotonic ordering, not the size of changes, causation, or agreement in the original measurement units.
How to enter data and read the counts
Provide x and y as numeric arrays of equal length, with each position describing the same observation in both arrays. At least two observations are required because a single observation cannot form a comparison pair. The result includes the number of observations, the total possible pairs, concordant pairs, discordant pairs, and three tie counts. ties_x means the x values match while y differs; ties_y means y matches while x differs; ties_both means both values match. In tau-a, every possible pair remains in the denominator, while a tied pair contributes zero to the concordant-minus-discordant numerator. This makes the calculation explicit and reproducible, especially when comparing the output with a textbook or another statistical package. Check the counts before interpreting tau: many ties can pull its magnitude toward zero, and that may reflect the resolution of the measurements rather than an absence of an ordered relationship.
When this calculator is the right choice
Use Kendall's tau when the order of observations is meaningful and you do not want to assume normal distributions, equal spacing, or a linear relationship. It is often appropriate for rankings, ordinal ratings, small samples, skewed measurements, and monotonic patterns that curve without reversing direction. For example, two reviewers may use different score ranges yet still rank products similarly; tau captures that ordering agreement. The calculator uses tau-a, so its denominator is every possible observation pair. If your data contain many ties and your analysis specifically requires tie-adjusted Kendall tau-b or a hypothesis-test p-value, use a statistical procedure designed for that specification and document the choice. Also remember that association is not causation: a strong tau can arise because both variables respond to another factor. Treat this result as a compact description of pairwise ordering, then combine it with subject knowledge, plots, sample design, and uncertainty analysis before making consequential decisions.
What you can do with it
Compare two rankings
Measure how consistently two judges, models, or scoring systems order the same set of items.
Analyze ordinal survey responses
Summarize monotonic association between ordered ratings without assuming equal distances between response levels.
Check a nonlinear trend
Detect consistent increasing or decreasing order when a relationship is monotonic but not well represented by a straight line.
FAQ
What does the result cost?
The API price is $0.002 per request, and the browser calculator is available directly on this page.
Which version of Kendall's tau is returned?
The calculator returns tau-a: concordant pairs minus discordant pairs, divided by all possible observation pairs.
What happens when the arrays have different lengths?
The request is rejected because each position in x must correspond to exactly one position in y.
How are ties handled?
Ties are reported separately. They contribute zero to the numerator and remain part of the total-pair denominator used by tau-a.
Can Kendall's tau prove causation?
No. It describes rank association only; it does not establish that either variable causes changes in the other.
For developers — API access
Everything on this page is available programmatically. This section is for teams who want to wire it into their own systems; everyone else can just use the tool above.
API endpoint
Prefer to automate it? One authenticated POST creates the task; the result comes back by webhook or a signed link. The same capability also runs here on the web, by email and from Telegram — and soon from our app too.
Call it from your stack
curl -X POST https://api.kit.forhosting.com/stat/kendall-tau \
-H "Authorization: Bearer $KIT_KEY" \
-H "Content-Type: application/json" \
-d '{"x":[1,2,3,4],"y":[1,3,2,4]}'const res = await fetch("https://api.kit.forhosting.com/stat/kendall-tau", {
method: "POST",
headers: {
"Authorization": `Bearer ${process.env.KIT_KEY}`,
"Content-Type": "application/json"
},
body: JSON.stringify({
"x": [
1,
2,
3,
4
],
"y": [
1,
3,
2,
4
]
})
});
const { task_id } = await res.json();import os, requests
res = requests.post(
"https://api.kit.forhosting.com/stat/kendall-tau",
headers={"Authorization": f"Bearer {os.environ['KIT_KEY']}"},
json={
"x": [
1,
2,
3,
4
],
"y": [
1,
3,
2,
4
]
},
)
task_id = res.json()["task_id"]<?php
$res = file_get_contents("https://api.kit.forhosting.com/stat/kendall-tau", false, stream_context_create([
"http" => [
"method" => "POST",
"header" => "Authorization: Bearer " . getenv("KIT_KEY") . "\r\nContent-Type: application/json",
"content" => '{"x":[1,2,3,4],"y":[1,3,2,4]}',
],
]));
$task = json_decode($res, true);body := bytes.NewBufferString(`{"x":[1,2,3,4],"y":[1,3,2,4]}`)
req, _ := http.NewRequest("POST", "https://api.kit.forhosting.com/stat/kendall-tau", body)
req.Header.Set("Authorization", "Bearer "+os.Getenv("KIT_KEY"))
req.Header.Set("Content-Type", "application/json")
res, _ := http.DefaultClient.Do(req)Example request
{
"x": [
1,
2,
3,
4
],
"y": [
1,
3,
2,
4
]
}Example response
{
"task_id": "tsk_a1b2c3d4e5f6a1b2c3d4e5f6",
"type": "stat.kendall_tau",
"status": "queued",
"_links": {
"result": "/tasks/tsk_…/result"
}
}The API is asynchronous: the call returns a task_id immediately and the result arrives by webhook. Polling is capped at 1 req/s per task.
Pricing
Published price — no tokens, no invented credits. A failed task is never charged.
Limits
max_n | 5000 |
Errors
| HTTP | Code | Meaning |
|---|---|---|
401 | unauthorized | Missing or invalid API key. |
402 | insufficient_balance | Your balance doesn't cover the task price. |
404 | unknown_type | That task type doesn't exist. |
429 | rate_limited | Too many requests. Use the webhook instead of polling. |