Mathwords logoMathwords

Somers' D — Definition, Formula & Example

Somers' D is a number between −1 and 1 that tells you how well one ranked variable predicts the ordering of another. It is asymmetric: you choose which variable predicts and which is predicted, and swapping them can change the value.

For paired observations (Xi,Yi)(X_i, Y_i) on ordinal scales, take every pair of observations. Somers' DYXD_{YX} is the number of concordant pairs minus the number of discordant pairs, divided by the number of pairs that are not tied on XX. Pairs tied on XX are excluded. Pairs tied on YY but not on XX stay in the denominator. This makes DYXD_{YX} a measure of association for YY given XX. In general DYX≠DXYD_{YX} \neq D_{XY}.

Key Formula

DYX=NC−NDNC+ND+TYD_{YX} = \frac{N_C - N_D}{N_C + N_D + T_Y}
Where:
  • DYXD_{YX} = Somers' D with Y as the predicted (dependent) variable and X as the predictor
  • NCN_C = Number of concordant pairs: X and Y are ordered the same way
  • NDN_D = Number of discordant pairs: X and Y are ordered in opposite ways
  • TYT_Y = Number of pairs tied on Y but not tied on X

How It Works

Compare every pair of observations. A pair is concordant if the observation with the higher XX also has the higher YY. It is discordant if the higher XX goes with the lower YY. Pairs tied on XX say nothing about how YY responds to a change in XX, so they are dropped. Pairs tied only on YY stay in the denominator and pull DYXD_{YX} toward 0, because there XX changed but YY did not.

Worked Example

Problem: A coffee shop surveys 5 customers. Visit frequency X is coded 1 = monthly, 2 = weekly, 3 = daily. Satisfaction Y is coded 1 = low, 2 = medium, 3 = high. The responses (X, Y) are A(1, 1), B(1, 2), C(2, 2), D(2, 3), and E(3, 2). Find Somers' DYXD_{YX}, where frequency predicts satisfaction. Then find DXYD_{XY} for comparison.
Step 1: Classify all (52)=10\binom{5}{2} = 10 pairs. Concordant: AC, AD, AE, BD. Discordant: DE, because D has lower frequency but higher satisfaction. Tied on Y only: BC, BE, CE. Tied on X only: AB, CD. No pair is tied on both.
NC=4,ND=1,TY=3,TX=2N_C = 4,\quad N_D = 1,\quad T_Y = 3,\quad T_X = 2
Step 2: Compute DYXD_{YX}. Drop the two pairs tied on X and keep the three pairs tied on Y.
DYX=4−14+1+3=38=0.375D_{YX} = \frac{4 - 1}{4 + 1 + 3} = \frac{3}{8} = 0.375
Step 3: Reverse the roles. Now pairs tied on Y are dropped and pairs tied on X stay in the denominator.
DXY=4−14+1+2=37≈0.429D_{XY} = \frac{4 - 1}{4 + 1 + 2} = \frac{3}{7} \approx 0.429
Answer: Somers' DYX=0.375D_{YX} = 0.375, a moderate positive association: more frequent visitors tend to be more satisfied. The reverse value DXY≈0.429D_{XY} \approx 0.429 differs because the two directions handle ties differently.

Why It Matters

Logistic regression output in SAS, Stata, and R often reports Somers' D next to the c statistic, which is the area under the ROC curve. Let X be the predicted probability and Y the binary outcome. Use the direction whose denominator counts the pairs with different outcomes, and count ties in X as half in c. In that setting DXY=2c−1D_{XY} = 2c - 1. The other direction, DYXD_{YX}, generally does not equal 2c−12c - 1.

Common Mistakes

Mistake: Treating Somers' D as symmetric, or reporting a value without saying which variable is the predictor.
Correction: DYXD_{YX} and DXYD_{XY} drop different tied pairs, so they usually differ when there are ties. In the example they are 0.375 and about 0.429. Always state the direction. If you want a symmetric measure, use Kendall's tau-b instead.

Related Terms