Gratis å bruke, uten konto

Kalkulator for Spearmans korrelasjon

Beregn Spearmans rangkorrelasjonskoeffisient (rho) fra parede verdier. Like verdier får gjennomsnittlig rangering; undersøk alle rangeringene og last ned en lokal CSV-fil.

Oppgi ett par per linje som x, y. Komma, semikolon eller mellomrom kan skille tallene. Bruk punktum som desimalskilletegn. Oppgi 2–500 par.

Like verdier får gjennomsnittsrangering. Rho beskriver monoton rangsammenheng, ikke årsakssammenheng. Kalkulatoren oppgir ikke p-verdi eller konfidensintervall; statistisk inferens krever forutsetninger som er spesifikke for studien.

Hvordan beregner jeg Spearman-korrelasjon?

Oppgi parvise x- og y-verdier, ett par per linje. Kalkulatoren gir like verdier gjennomsnittsrangering og beregner deretter Pearson-korrelasjonen mellom de to rangeringslistene.

Veiledning

Slik bruker du Kalkulator for Spearmans korrelasjon

This calculator finds Spearman's rank correlation, written rho, for pairs of numbers. Enter one x and y pair per line. The tool ranks the x values and the y values, gives tied values the average of their rank positions, and then computes the Pearson correlation of those two lists of ranks. You also get a table of every rank, a small rank chart and a CSV download. It does not give a p-value or a confidence interval, and it cannot say that one thing causes another.

Slik gjør du

  1. Type your data into the Paired values box, one pair per line, as x then y. A comma, a semicolon or spaces can sit between the two numbers.
  2. Use a period for decimals. You need at least 2 pairs and at most 500, and each value must be no larger than 1,000,000,000,000 in size.
  3. Press Calculate rho. The Spearman rho, the number of pairs, a rank chart and a table of x, y and both ranks appear.
  4. Press Load example to try five pairs that rise together, or Download CSV to save the rho, the count and the ranked pairs.
  5. If a short error message appears, check that every line has exactly two numbers and that neither column has the same value in every row.

Eksempler

A perfect rising order

Du skriver inn
Parverdier
1, 10 2, 20 3, 30 4, 40 5, 50
Du får
Rho
1
Parverdier
5

Both columns are already in the same order, so the ranks match exactly: 1 to 5 for x and 1 to 5 for y. This is the pair set the Load example button fills in.

Kjørt med verktøyets egen kode.

One extreme value

Du skriver inn
Parverdier
1, 1 2, 100 3, 2 4, 3 5, 4
Du får
Rho
0.4
Rangering y
1, 5, 2, 3, 4

The big 100 only counts as the highest rank, 5. The squared rank gaps are 0, 9, 1, 1 and 1, so rho is 1 minus 6 times 12 over 5 times 24, which is 0.4.

Kjørt med verktøyets egen kode.

A tie in the y values

Du skriver inn
Parverdier
1, 2 2, 2 3, 3 4, 5 5, 4
Du får
Rho
0.8720816
Rangering y
1.5, 1.5, 3, 5, 4

The two 2s fill rank places 1 and 2, so each gets 1.5. The page shows 7 significant digits, and a note says average ranks were used.

Kjørt med verktøyets egen kode.

A series with no variation

Du skriver inn
Parverdier
1, 3 2, 3 3, 3
Du får
Melding
Check that every line has two valid values and neither series is constant.

Every y is 3, so all ranks are equal and the correlation is undefined. The tool shows a message and no rho.

Kjørt med verktøyets egen kode.

Når det er nyttig

  • Checking if two rankings, such as judges' scores, tend to go up and down together.
  • Studying data that rises or falls steadily but not in a straight line.
  • Learning how ranks and ties work in a statistics class.
  • Comparing two lists that include a few extreme values that would distort a straight-line measure.
  • Getting the ranks as a CSV file to use in another program.

Begrensninger

  • Between 2 and 500 pairs are allowed, and values above 1,000,000,000,000 in size are refused.
  • There is no p-value, no confidence interval and no test of significance. The page itself says inference needs study-specific assumptions.
  • Rho describes how well one variable follows the other in order. It does not show cause and effect.
  • If every x, or every y, is the same value, rho is undefined and the tool shows an error message instead of a number.
  • The rho shown is rounded to 7 significant digits for display, while the CSV file keeps the full value.

Tips

  • Put one observation on each line and keep x and y in the same order for every row.
  • Read the rank table when a result surprises you. Ranks show where a tie or an extreme value changed things.
  • Draw your original x and y values as a plain scatter plot as well, since rho can look strong when the pattern is odd.
  • Do not label a rho as weak or strong on a single rule of thumb. Different fields use different cut-offs.

Kilder

Vanlige spørsmål

What does Spearman rho measure?

It measures how well the order of one variable matches the order of the other. A value of 1 means the ranks rise together exactly, and -1 means one rises as the other falls. It looks at order, not at the size of the gaps between values.

How does the tool handle tied values?

Tied values share the average of the rank places they fill. Two values that tie for places 1 and 2 each get 1.5. Wikipedia describes the same average-rank approach for identical values.

Which formula is used?

Rho is the Pearson correlation between the two rank lists, which is the standard definition. The short 1 minus 6 times the sum of squared gaps formula only works when no ranks are tied, so the tool does not rely on it.

What is the difference from Pearson correlation?

Pearson works on the raw values and measures straight-line fit. Spearman first turns the values into ranks. A curve that always rises can give a Spearman rho of 1 while Pearson on the raw values stays below 1.

Can I enter negative numbers or decimals?

Yes. Signs and decimal points with a period are accepted, as is scientific notation such as 1e3. The tool also reads Arabic-Indic digits. Commas separate the x and y values, so they cannot be used as decimal marks.

Why do I get an error for my data?

The usual causes are a line with more or fewer than two values, text that is not a number, fewer than 2 or more than 500 lines, or a column where every value is identical. The page shows one general message, so check these in turn.

Does the tool give a p-value?

No. It only reports rho and the number of pairs. If you need a significance test or a confidence interval, you will need other software and a clear idea of your study design.

Is my data uploaded?

No. The calculation runs in your browser and the values are not uploaded or saved by the tool. The CSV is built on your device when you press Download CSV.

When should I not trust the result?

Be careful with very few pairs, with many ties, or with data that is not truly paired. A rho from a handful of points can be large by chance, and the tool gives no measure of that uncertainty.

Hvordan beregner jeg Spearman-korrelasjon?

Oppgi parvise x- og y-verdier, ett par per linje. Kalkulatoren gir like verdier gjennomsnittsrangering og beregner deretter Pearson-korrelasjonen mellom de to rangeringslistene.

Lastes verdiene mine opp?

Nei. Beregningen kjøres i nettleseren. Verdiene lastes ikke opp eller lagres av dette verktøyet.

Hva måler Spearmans rho?

Den oppsummerer retningen og styrken på et monotont forhold ved hjelp av rangeringer. Den fastslår ikke at én variabel forårsaker en annen.

Hvordan rangeres like verdier?

Alle like observasjoner får gjennomsnittet av rangeringsplassene de opptar. Hvis for eksempel to verdier deler første- og andreplass, får begge rang 1.5.

Er Spearmans rho det samme som Pearson-korrelasjon?

Nei. Spearmans metode beregner Pearson-korrelasjon etter at hver variabel er rangert. Den måler dermed en monoton sammenheng mellom rangeringene, ikke et lineært forhold mellom de opprinnelige verdiene.