Somers' D Calculator

Analyze ordinal association using pairwise summary tools. Check ties, switch directions, and validate data quickly. Download polished outputs and explore trends through interactive visuals.

Enter paired ordinal data

Place matching observations in the same order. Use integers or decimal ranks, separated by commas, spaces, semicolons, or new lines.

Plotly relationship graph

The heatmap shows how often each ordered X level pairs with each ordered Y level.

Submit your data to generate the heatmap.

Formula used

Somers' D is a directional measure for two ordinal variables.

Somers' DY|X = (C − D) / (C + D + TY)

Somers' DX|Y = (C − D) / (C + D + TX)

A pair is concordant when higher X also has higher Y. A pair is discordant when higher X has lower Y. Pairs tied on both variables add no directional ordering information.

This page also reports Goodman-Kruskal gamma and Kendall tau-a for extra context.

How to use this calculator

  1. Enter a label for each ordinal variable.
  2. Paste the X values into the first list.
  3. Paste the matching Y values into the second list.
  4. Choose which Somers' D direction to emphasize.
  5. Set the number of displayed decimal places.
  6. Click Calculate Somers' D.
  7. Review the result panel, pair counts, and graph.
  8. Download the summary as CSV or PDF if needed.

Example data table

Use this sample if you want to test the calculator quickly.

Observation Example X Example Y
111
212
322
423
533
634
744
844
955
1055

FAQs

1) What does Somers' D measure?

It measures directional association between two ordinal variables. Positive values mean higher ranks tend to occur together. Negative values mean inverse ordering. Values near zero suggest weak monotonic structure.

2) How is Somers' D different from gamma?

Gamma ignores tied pairs in its denominator. Somers' D keeps the directional idea and includes ties on the dependent side, so it is usually more conservative for predictive ordering work.

3) Why are there two Somers' D values?

The statistic is asymmetric. D(Y|X) asks how well X orders Y. D(X|Y) asks the reverse. They become identical only in limited situations.

4) What type of data should I enter?

Use paired ordinal codes with equal lengths, such as survey ratings, ranks, severity classes, or ordered categories converted to numbers like 1 through 5.

5) How do ties affect the result?

Pairs tied on both variables provide no ordering direction. Pairs tied on only one side affect the denominator, which can reduce the coefficient compared with gamma.

6) What does a negative value mean?

A negative value means higher ranks on one variable tend to pair with lower ranks on the other. It signals inverse ordinal association.

7) When can the result be undefined?

If every relevant pair is tied for the chosen direction, the denominator becomes zero. In that case, Somers' D cannot be estimated from the submitted data.

8) Can I use text categories directly?

Not in this version. Recode ordered text categories into numeric ranks first, while preserving their original order across both input lists.

Related Calculators

brunner munzel testspearman rank correlation calculatorkolmogorov smirnov test calculatoriqr calculatorkernel density estimatorfisher exact test calculatorgoodman kruskal gammacramer v calculatortheil sen estimatorkruskal wallis test calculator

Important Note: All the Calculators listed in this site are for educational purpose only and we do not guarentee the accuracy of results. Please do consult with other sources as well.