Correlation and Association
Somers' D
Somers' d measures how well one ordered variable predicts another's order.
Somers' d takes two ordered variables measured on the same people, one treated as the predictor, and measures how well the predictor's order foretells the outcome's order, with a z test of whether it differs from zero.
Are students who attend more classes more satisfied with the course? One hundred eighty students in an introductory course were sorted by how many classes they attended (under half, half to most, nearly all) and rated their satisfaction with the course on a 5-point scale.
- Tests
- Population Somers' d (outcome dependent)
- Observations
- Independent
- Parametric
- No
- Headline Statistic
- d_{YX}
- Effect Size
- Somers' d_{YX}
- Groups
- 1
The Basics
When to Use It
Use it when you have two ordered variables measured on the same people, such as bands, levels or rating-scale answers, and one of them is the natural predictor of the other. It answers how well knowing someone's place on the predictor tells you their place on the outcome, with many people sharing the same category. For example:
- Are students who attend more classes more satisfied with the course?
- Do clients who attend more therapy sessions (1–4, 5–8, 9 or more) report more improvement on a 5-point rating?
- Does a child's reading level (below, at or above grade) predict their teacher's rating of classroom confidence (low, medium, high)?
Vocabulary You Need
Definition Contingency Table
A table that cross-classifies people on two categorical variables, one along the rows and one along the columns, so each cell counts the people with that combination. The row and column totals (the margins) show how each variable is spread on its own; the cells show how the two go together. Tables are described by their size, rows × columns, such as a 2 × 3 table. Glossary →
Definition Concordant Pair (C)
Two people who differ on both of two ordered variables, where the one who is higher on the first is also higher on the second. Counting concordant pairs, against discordant ones, is how rank measures such as Kendall's τ, Somers' d and Goodman and Kruskal's γ measure a one-direction association without using the distances between scores. In a contingency table with both variables in order, a cell's concordant partners sit below and to the right of it (and above and to the left). Glossary →
Definition Discordant Pair (Ordinal) (D)
Two people who differ on both of two ordered variables, where the one who is higher on the first is lower on the second. They are the evidence against a positive association, just as concordant pairs are the evidence for one. In a contingency table with both variables in order, a cell's discordant partners sit below and to the left of it (and above and to the right). Not the same idea as a discordant pair in McNemar's test, which is one person whose yes/no answer changed. Glossary →
Definition Tied Pair
Two people who share the same category on one variable (tied on X), on the other (tied on Y), or on both. With ordered categories such as ratings or bands, most pairs are tied on something. Ordinal measures of association differ mainly in what they do with ties: gamma leaves out every tied pair; Somers' d_YX leaves out pairs tied on the predictor but keeps pairs tied only on the outcome, counting them as failed predictions; Kendall's tau-b keeps pairs tied on just one variable in its denominator, splitting the difference between the two Somers' d's (it's their geometric mean). Glossary →
Assumptions and Inference
1. Two Ordered Variables Both variables' categories run from less to more of something, and the predictor has at least two observed categories, so some pairs differ on it and d can be computed.
- What It Means
- Both variables must have a direction, so every pair of people can be compared as more or less on each: attendance bands run from under half to nearly all classes, and satisfaction ratings from very dissatisfied to very satisfied. Unordered categories don't qualify. Somers' d uses only that order, not the distances between categories. If everyone shares one predictor category, no pair differs on it and d is 0 ÷ 0.
- Applies To
- Outcome
- How to Check
- By design. Ask whether a higher score means more of something. Then count how many people gave tied scores, since ties carry less information about the order.
- How Much It Matters
- Complete. Concordant and discordant only mean something if both variables have a direction. Shuffle the order of one variable's categories and d changes, even though nothing about the people did. Attendance bands and satisfaction ratings both have a clear order.
What to Do
- Alternative Test Cramér's V. If either variable's categories have no order (major, therapy type), measure the association with Cramér's V and test it with a chi-square test.
- Design Change Code categories as numbers in their real order (1 = under half, 2 = half to most, 3 = nearly all). Text labels are sorted alphabetically by software, which scrambles the order.
2. Monotonic Association (for What d Means) d summarizes an overall tendency for the outcome to move in one direction as the predictor rises; it can be computed for any pattern, but a relationship that rises and then falls can give a d near zero.
- What It Means
- The relationship keeps one direction across the whole range of scores, though it doesn't have to be a straight line or change at a steady rate. Rank-based coefficients summarize how consistently it keeps that direction, so a relationship that rises and then falls can show a coefficient near zero even when the two variables are strongly related.
- Applies To
- Variables
- How to Check
- Look at a scatterplot, ideally with a smooth trend line through it. For a small table of ordered categories, look instead at the percentages within each category (or a stacked bar chart): the share at the high end should move one way across the categories. A trend that bends but keeps going the same way is fine; one that clearly turns around, like a U or an inverted U, is not. It's a question about the shape, so decide by looking, not by a test.
- How Much It Matters
- A lot, for what d means. d counts whether higher goes with higher, so a relationship that rises and then falls produces concordant and discordant pairs that cancel out, and d can land near zero despite a real association. In the attendance study the share of satisfied students climbs steadily across the three bands (28%, 41%, 52%).
What to Do
- Proceed with Caveat If the relationship turns back, don't summarize it with one number. Show the row percentages and describe where it turns.
- Alternative Test Pearson Chi-Square Test. To look for any kind of association, including a rise-and-fall that d can miss, use a chi-square test. It ignores the order, so it has less power for a steady trend and says nothing about direction.
3. Independent Observations (for the p-Value and Interval) The people (or other units) in your study don't influence each other.
- What It Means
- Each person's data comes from a separate, unconnected source, so knowing one person's scores tells you nothing about anyone else's. In designs that measure people more than once, their own scores are meant to be related; it's different people who must be independent. Methods built for clustered data, such as multilevel models and GEE, also allow members of the same group to be related, as long as the analysis names the grouping; then it's the groups that must be independent.
- Applies To
- Observations
- How to Check
- By design, not by a test. Did each person contribute their own data, with no clusters such as roommates, couples, therapy groups or classrooms whose members influence each other? If there are clusters, does the analysis model every one of them?
- How Much It Matters
- A lot. The pair counts treat every person as a separate, unconnected case. If students come in clusters, such as friends who attend and rate the course together, the standard errors come out too small and p too small. The pairs themselves aren't independent, since each person appears in many of them; d's standard errors already allow for that overlap, but not for links between people.
What to Do
- Design Change Give each student one attendance band and one rating, and sample students independently.
- Alternative Test Ordinal Regression. If people come in clusters (sections, therapy groups, families), an ordinal regression with a random effect for the cluster models the dependence instead of ignoring it.
4. Enough Data in the Table (for the p-Value and Interval) The z test and the Wald interval are large-sample approximations, which need a reasonable sample spread over the table.
- What It Means
- The z test and the interval d ± 1.96 × SE treat d as roughly normal, which holds once the sample is reasonably large and the table isn't sparse. With few people, many near-empty cells, most people in one row or column, or d near ±1, the approximations can be poor.
- Applies To
- Observations
- How to Check
- Look at the table's counts and d's size. With a small sample, several near-empty cells, or d near ±1, check p with an exact or permutation test and use a bootstrap interval.
- How Much It Matters
- Some, for p and the interval only. The attendance study has 180 students; its smallest cells hold 3, but most hold far more, and a permutation test (20,000 shuffles) gives p = .004, close to the z test's .003.
What to Do
- Robust Estimation Shuffle one variable a few thousand times and count how often d lands at least as far from zero, or click Exact in SPSS Crosstabs (Mehta & Patel, 2021).
- Robust Estimation Resample people a few thousand times and take the middle 95% of the d values; say which method you used.
Limitations
This Is Not Your Test If…
- Your categories have no natural order Cramér's V →
- Neither variable is the natural predictor and you want every tied pair left out Goodman and Kruskal's Gamma →
- Your variables are scores with few ties Spearman Correlation →
- You're predicting from several variables at once Ordinal Regression →
- You're comparing two groups on a rating Mann-Whitney U Test →
- You're checking whether two raters agree Agreement and Reliability →
What It Doesn't Tell You
- Why. Calling attendance the predictor is a choice about the question, not evidence that attending causes satisfaction; satisfied students may simply keep coming, or keen students may do both.
- Whether it matters. Significance doesn't make a d of .20 important; whether a 24-point gap in satisfaction between the lowest and highest attenders is worth acting on is a teaching judgment, and acting on it through attendance would need evidence that attendance drives satisfaction.
- Who else. The result describes students like these 180 in one course, and only as well as three attendance bands and one end-of-term rating capture what they did and felt.
- Whether the p and interval hold up in a small or sparse table. Both rest on a large-sample normal approximation. With few people, or most of them in a few cells, the p can be off and the interval can even run past ±1. Use an exact or permutation p (in SPSS, Crosstabs › Exact; Mehta & Patel, 2021) and a bootstrap interval.
- That there's no association, if p had been above .05. A non-significant d would have meant the data were inconclusive, not that attendance and satisfaction are unrelated. It also can't see a pattern that rises and then falls.
Common Mistakes
-
Don'tReport Somers' d without saying which variable is the dependent one.
InsteadName it, as in “d with satisfaction dependent” or d_YX. The two directions give different values.
-
Don'tChoose the direction after seeing which d is larger.
InsteadFix the predictor before the analysis, from the design or the question. If neither variable is the natural predictor, report the symmetric d or Kendall's tau-b, which keep pairs tied on one variable. Gamma leaves every tie out, so it is never closer to zero; if you choose it, say so.
-
Don'tCompare a Somers' d from one study with a gamma from another.
InsteadCompare like with like. Gamma ignores tied pairs, so for the same table it is never closer to zero than d.
-
Don'tRead “predictor” and “dependent” as cause and effect.
InsteadTreat the direction as a choice about which variable you're predicting. Only the design can support a causal claim.
-
Don'tRun a chi-square test on two ordered variables and conclude there's no association.
InsteadUse an ordinal measure. Chi-square ignores the order, so it can miss a steady trend that Somers' d picks up.
-
Don'tRead a p-value as the chance that the null hypothesis is true.
InsteadRead it as: if the null were true, how often data at least this extreme would turn up.
Result Decoder
Significance and Effect Size Guidelines
Benchmarks Significance (p Value)
-
p < .001
Very strong evidence against the null hypothesis.
-
.001 ≤ p < .01
Strong evidence against the null hypothesis.
-
.01 ≤ p < .05
Statistically significant at α = .05. Moderate evidence against the null hypothesis.
-
.05 ≤ p < .10
Not significant. Weak evidence; sometimes called a “trend.” Treat it as inconclusive.
-
p ≥ .10
Not significant. Little evidence against the null, which is not the same as evidence of no effect.
These evidence labels are one common convention for describing p in graded language rather than as significant or not; the boundaries are rough guides, not rules, and other authors draw them differently. Muff et al. (2022) argue for this kind of language of evidence over a single cutoff. α is chosen before the analysis, and p never says how big or important an effect is.
Benchmarks Effect Size (Somers' d_{YX})
-
|d| < .10
Below Small
Smaller than the conventional small benchmark. Whether an effect this size matters depends on the setting.
-
.10 ≤ |d| < .30
Small
Of every 100 pairs who differ on the predictor, the predictor gets the outcome's order right 10 to 30 more times than wrong. A relatively modest association, by convention.
-
.30 ≤ |d| < .50
Medium
Of every 100 pairs who differ on the predictor, the predictor gets the outcome's order right 30 to 50 more times than wrong. A moderate association, by convention.
-
|d| ≥ .50
Large
Of every 100 pairs who differ on the predictor, the predictor gets the outcome's order right at least 50 more times than wrong. A relatively substantial association, by convention.
Somers' d has no generally accepted benchmarks. These are Cohen's (1988) cutoffs for a correlation, sometimes borrowed, but the two measures aren't interchangeable: for two continuous, normally distributed scores with no ties, a d (or Kendall's τ) of .20 goes with an r of about .31 (Greiner's relation; Newson, 2002). That conversion doesn't carry over to coarse categories with many ties like the attendance study's, so our d of .20 implies no particular r. Read d through its pairs (about 48 right orderings to 28 wrong in every 100), the row percentages and the setting. Gamma for the same table is .26; the two aren't interchangeable: gamma ignores ties, so it is never closer to zero than d. Not measures of practical importance.
How It's Reported
Equation Form
dYX = .20, 95% CI [.07, .33], z = 2.96, p = .003
Table 1. Ordinal Measures of Association between Attendance and Course Satisfaction
| Value | SE | 95% CI | z | p | |
|---|---|---|---|---|---|
| Somers' d, satisfaction dependent | .20 | .067 | [.07, .33] | 2.96 | .003 |
| Somers' d, attendance dependent | .17 | .056 | [.06, .28] | 2.96 | .003 |
| Somers' d, symmetric | .18 | .061 | [.06, .30] | 2.96 | .003 |
| Goodman and Kruskal's gamma | .26 | .086 | [.09, .43] | 2.96 | .003 |
Note. N = 180. SE is the asymptotic standard error not assuming the null (ASE₁), which gives the 95% CI. z divides each estimate by its standard error assuming the null (ASE₀); that comes to the same value for all four measures, so they share one z and p.
Full Text (APA Style)
Students who attended more classes tended to be more satisfied with the course: 52% of those who attended nearly all classes were satisfied or very satisfied, against 41% of those who attended half to most and 28% of those who attended under half. Predicting satisfaction from attendance, Somers' dYX = .20, 95% CI [.07, .33]. It was statistically significant, z = 2.96, p = .003.
- Say which variable is dependent: “with satisfaction dependent,” or write dYX and define Y and X. The other direction here is .17.
- Give the row percentages, so readers can see the trend d summarizes.
- Say which standard error you used: the interval uses the one not assuming the null (ASE₁), and the test uses the one assuming it (ASE₀). SPSS labels the test “Approx. T,” but it's compared with the normal curve, so write z.
- Italicize d, z and p, drop the leading zero for d and p, and report exact p to three decimals.
Reading Each Piece
The equation form above, piece by piece, in this order: how big, how certain, then how surprising.
| dYX = .20 | Of every 100 pairs of students in different attendance bands, the better attender was more satisfied in about 20 more pairs than they were less satisfied (about 48 vs. 28, with about 23 tied on satisfaction). Small by the cutoffs borrowed from correlations, which weren't written for Somers' d; whether a difference this size matters is a question about teaching, not statistics. Benchmarks ↑ |
| 95% CI [.07, .33] | The population d is plausibly anywhere from a barely-there .07 to a moderate .33. The whole range is above zero, so better attenders do tend to be more satisfied, but the size isn't pinned down well. |
| z = 2.96 | d is 2.96 standard errors above zero, using the standard error that assumes no association. SPSS shows this as “Approx. T.” |
| p = .003 | If attendance and satisfaction were unrelated, an ordering at least this lopsided, in either direction, would turn up about 0.3% of the time. That's below .05, so the association is statistically significant. Benchmarks ↑ |
Calculations
The Running Example
The attendance study: 180 undergraduates, each with an attendance band (40 under half, 80 half to most, 60 nearly all) and a 5-point course satisfaction rating, with attendance as the predictor.
- Null Hypothesis:
- \Delta_{YX} = 0
- Alternative (Two-Sided):
- \Delta_{YX} \neq 0
\Delta_{YX} (“delta”) is Somers' d in the population of students like these, with satisfaction (Y) as the outcome and attendance (X) as the predictor: among pairs of students in different attendance bands, the chance the better attender is more satisfied minus the chance they're less satisfied. The sample's estimate is .20. The test is of that one quantity: the variables being unrelated (independent) implies \Delta_{YX} = 0, but \Delta_{YX} = 0 doesn't imply they're unrelated, since a pattern that rises and then falls can balance out. So a non-significant result doesn't rule out every kind of association.
What Your Data Should Look Like
One row per person, with one column for each variable, coded as numbers in their real order (1 = lowest). Software builds the table of counts; put the predictor in the rows so the output's labels match your question.
Our 180 rows make this 3 × 5 table, attendance down the side and satisfaction across the top. Moving down from one attendance band to the next, the ratings shift toward the satisfied end.
| student | attendance | satisfaction |
|---|---|---|
| 1 | 1 | 4 |
| 2 | 2 | 4 |
| 3 | 3 | 4 |
| 4 | 2 | 3 |
| 5 | 3 | 5 |
| 6 | 2 | 1 |
| … 174 more rows | ||
| Very Dissatisfied | Dissatisfied | Neutral | Satisfied | Very Satisfied | Total | |
|---|---|---|---|---|---|---|
| Under Half | 7 (18%) | 8 (20%) | 14 (35%) | 8 (20%) | 3 (8%) | 40 |
| Half to Most | 5 (6%) | 15 (19%) | 27 (34%) | 19 (24%) | 14 (18%) | 80 |
| Nearly All | 3 (5%) | 7 (12%) | 19 (32%) | 18 (30%) | 13 (22%) | 60 |
| Total | 15 | 30 | 60 | 45 | 30 | 180 |
Counts, with each row's percentages.
Simulated data.
Napkin Math
The whole test, one idea at a time. Under each heading, a line says why the step matters, and the green note reads the equation in plain English with the attendance study's numbers. Collapse all to read just the headings: they tell the whole story on their own.
-
1. Pair Up Every Two Students
Somers' d works on pairs of people, not on single scores. Each pair is one small piece of evidence: does the student who attended more also rate the course higher?
\text{pairs} = \dfrac{n(n - 1)}{2} =\dfrac{180 \times 179}{2}\text{pairs} = 16110
n is our 180 students. Each can be paired with 179 others, and dividing by 2 stops every pair being counted twice: 16,110 pairs.
-
2. Count the Pairs Where Attendance and Satisfaction Go the Same Way, and the Pairs Where They Don't
In a concordant pair, the better attender is also more satisfied. In a discordant pair, the better attender is less satisfied. The table gives both counts without listing a single pair.
C = \sum_{i,j} n_{ij} \sum_{k > i,\; l > j} n_{kl}, \qquad D = \sum_{i,j} n_{ij} \sum_{k > i,\; l < j} n_{kl} =7 \times 132 + \cdots, \quad 3 \times 113 + \cdots= 5035 pairs
D = 2955
n_{ij} is one cell's count. The 7 under-half attenders who were very dissatisfied pair concordantly with the 132 students below and to their right (better attenders, more satisfied): 7 × 132 = 924 pairs. The 3 under-half attenders who were very satisfied pair discordantly with the 113 below and to their left. Over all 15 cells, C = 5,035 and D = 2,955.
-
3. Set Aside the Pairs Where Attendance Doesn't Differ
We're predicting satisfaction from attendance, so a pair of students in the same attendance band can't test the prediction. Pairs in different bands but with the same rating stay in: attendance predicted a difference and there wasn't one.
C + D + T_Y = \dfrac{n^2 - \sum R_i^2}{2} =\dfrac{180^2 - (40^2 + 80^2 + 60^2)}{2}= 10400 pairs
T_Y = 2410
\text{set aside} = 5710 pairs
R_i are the band sizes, 40, 80 and 60. 32,400 − 11,600 = 20,800, halved is 10,400 pairs in different bands: 5,035 concordant, 2,955 discordant and T_Y = 2,410 with the same rating. The other 5,710 pairs share a band and are set aside.
-
4. Measure How Much More Often Attendance Gets the Order Right than Wrong
Out of the pairs that could test the prediction, take the share where the better attender is more satisfied and subtract the share where they're less satisfied. That's Somers' d.
d_{YX} = \dfrac{C - D}{C + D + T_Y} =\dfrac{5{,}035 - 2{,}955}{10{,}400}= .20
C - D is 5,035 − 2,955 = 2,080 more right orderings than wrong ones, and C + D + T_Y is the 10,400 pairs in different bands. 2,080 ÷ 10,400 = .20.
-
5. Figure Out How Precisely the Sample Pins Down d
Another 180 students would give a somewhat different d. The standard error measures how much. This version doesn't assume the true d is zero, so it's the one for a range of plausible values.
ASE_1 = \dfrac{2}{D_r^{2}}\sqrt{\sum_{i,j} n_{ij}\left[D_r\,(C_{ij} - D_{ij}) - (P - Q)(n - R_i)\right]^{2}} =\dfrac{2}{20{,}800^{2}}\sqrt{\textstyle\sum_{i,j} n_{ij}\,[\,\cdots\,]^{2}}= 0.067
D_r is 20,800, our 10,400 pairs counted in both orders, as SPSS does. P and Q are C and D doubled the same way (10,070 and 5,910). C_{ij} isn't step 2's C: it counts the people concordant with one person in cell ij, looking both ways (above-left as well as below-right), D_{ij} the people discordant with them, and R_i is that person's band size. The square bracket compares each cell's concordant-minus-discordant count with what d predicts for it, and the sum runs over all 15 cells: software does this one. It comes to 0.067.
-
6. Give a Range of Plausible Values for the True d
Instead of a single best guess, give the range of population values of d that fit the data.
d_{YX} \pm z^{*} \times ASE_1 =.20 \pm 1.960 \times 0.067= [.07, .33]
z^{*} = 1.960 holds the middle 95% of the normal curve, and ASE_1 is 0.067. 1.960 × 0.067 = 0.131, so the range is .20 ± .13, from .07 to .33.
-
7. Compare d with How Much It Would Vary If Attendance Predicted Nothing
To test, we need the standard error as it would be if there were no association at all. Dividing d by it gives z, the number of those standard errors d sits from zero.
z = \dfrac{d_{YX}}{ASE_0} =\dfrac{.20}{0.0675}= 2.96
ASE_0 = 0.0675
ASE_0, worked out as if the true d were zero, is 0.0675, a touch bigger than ASE_1. .20 ÷ 0.0675 puts d 2.96 null standard errors above zero.
-
8. Ask How Surprising This Would Be If Attendance and Satisfaction Were Unrelated
Finally, ask how often chance alone would produce an ordering at least this lopsided, in either direction, if attendance told us nothing about satisfaction.
p = 2 \times P(Z \ge |z|) =2 \times P(Z \ge 2.96)= .003
P(Z \ge 2.96) is the chance a standard normal value lands at or above 2.96, about .0015. Doubling it counts both directions: .003, about 1 in 330.
-
9. Turn the Question Around and Compare
Predicting attendance from satisfaction sets aside a different set of ties, the pairs with the same rating, so d changes. The symmetric d splits the difference, and gamma drops every tie.
d_{XY} = \dfrac{C - D}{C + D + T_X} =\dfrac{2{,}080}{12{,}375}d_{XY} = .17
d_{\text{sym}} = .18
\gamma = .26
The numerator is still C - D = 2,080, but now the denominator is the 12,375 pairs with different ratings: 5,035 + 2,955 + T_X = 4,385 in the same band but different ratings. So d_{XY} = .17. Averaging the two denominators gives the symmetric d, .18, and gamma, 2,080 ÷ (5,035 + 2,955), is .26.
Run It in Software
The code below reads the running example's data from data.csv; save it in the same folder you run the code from.
SPSS (version 30, as documented by IBM)
- Analyze → Descriptive Statistics → Crosstabs.
- Move
attendanceinto Row(s) andsatisfactioninto Column(s). - Click Statistics, check Somers' d, Gamma and Kendall's tau-b under Ordinal, and click Continue.
- Click Cells, check Observed and Row percentages, and click Continue, then OK.
Or paste this syntax:
CROSSTABS /TABLES=attendance BY satisfaction /FORMAT=AVALUE TABLES /STATISTICS=D GAMMA BTAU /CELLS=COUNT ROW /COUNT ROUND CELL.
Reading the Output
Look at the row percentages in the Crosstabulation first (the pattern). Then, in Directional Measures, read the satisfaction Dependent row: the Value (the size), the Asymptotic Standard Error (for the interval), and the Approximate Significance (the test).
Directional Measures
| Value | Asymptotic Standard Errorᵃ | Approximate Tᵇ | Approximate Significance | |||
|---|---|---|---|---|---|---|
| Ordinal by Ordinal | Somers' d | Symmetric | .183 | .061 | 2.963 | .003 |
| attendance Dependent | .168 | .056 | 2.963 | .003 | ||
| satisfaction Dependent | .200 | .067 | 2.963 | .003 |
a. Not assuming the null hypothesis. b. Using the asymptotic standard error assuming the null hypothesis.
Symmetric Measures
| Value | Asymptotic Standard Errorᵃ | Approximate Tᵇ | Approximate Significance | ||
|---|---|---|---|---|---|
| Ordinal by Ordinal | Kendall's tau-b | .183 | .061 | 2.963 | .003 |
| Gamma | .260 | .086 | 2.963 | .003 | |
| N of Valid Cases | 180 |
SPSS prints all three versions of d; pick the one whose dependent variable is your outcome, decided before you looked. Footnote a is the key to the interval: .200 ± 1.96 × .067 gives [.07, .33]. Footnote b explains why every row shares one “Approximate T”: the test divides by the standard error assuming no association, and that comes to the same z for every measure. It's compared with the normal curve, so report it as z = 2.96.
Output laid out from this page's computed results, not captured from a live run; labels and layout may differ slightly in your version.
R
library(DescTools)
attend <- read.csv("data.csv")
tab <- table(attend$attendance, attend$satisfaction) # rows = attendance (X)
# direction = "column": the column variable (satisfaction) is dependent
SomersDelta(tab, direction = "column", conf.level = 0.95)
# The other direction (attendance dependent)
SomersDelta(tab, direction = "row")
GoodmanKruskalGamma(tab)
somers lwr.ci upr.ci
0.20000000 0.06867595 0.33132405
[1] 0.1680808
[1] 0.2603254
direction = "column" returns d with the column variable (satisfaction) dependent. DescTools' help wording for direction is easy to read the other way, so check that the satisfaction-dependent value is the one whose denominator leaves out pairs in the same attendance band (.20 here). The interval uses the same standard error as SPSS's. DescTools doesn't print a p-value for Somers' d; take it from SPSS or Python, which use the standard error assuming no association.
Output from a real run: R 4.6.1 (DescTools 0.99.60), run 2026-10-03.
Python
import pandas as pd
from scipy import stats
attend = pd.read_csv("data.csv")
# x is the predictor (the table's rows), y the outcome: returns d with y dependent
res = stats.somersd(attend["attendance"], attend["satisfaction"])
res.statistic # 0.2
res.pvalue # 0.003048
res.table # the 3 x 5 table of counts
# The other direction
stats.somersd(attend["satisfaction"], attend["attendance"]).statistic # 0.1681
somersd(x, y) treats x as the independent (row) variable, so swap the arguments to get the other direction. Its p uses the standard error assuming no association (Brown & Benedetti, 1977), so it matches SPSS's .003 and is the same for both directions. scipy doesn't return a standard error or interval for d; use SPSS or R for the interval.
Output from a real run: Python 3.9.6 (scipy 1.12.0, pandas 2.3.3), run 2026-10-03.
Impact
Effect Size
Somers' d is its own effect size. It counts, among the pairs of people who differ on the predictor, how much more often the outcome goes the same way than the opposite way. It runs from −1 to 1 and has no units, but its size still depends on how many categories each variable has and how people spread across them: more pairs tied on the outcome pull it toward zero. Compare it across studies only when they use similar categories and put the same variable in the dependent role.
Among pairs of students in different attendance bands, the better attender was the more satisfied one 20 percentage points more often than the less satisfied one. Turned around, attendance predicted from satisfaction, it's .17, because a different set of tied pairs is left out.
The asymmetry is the point of the measure. Pairs with the same satisfaction rating but different attendance count against dYX, because attendance predicted a difference that didn't show up; gamma drops them and comes out at .26. There are no benchmarks written for Somers' d, so the ones above are borrowed from correlations, and conventions at that. A 24-point gap in the share of satisfied students between the lowest and highest attenders is the number a course coordinator would weigh.
Benchmarks Somers' d_{YX} at a Glance
Statistical Significance
p answers one narrow question: if the two variables were unrelated in the population, how often would a sample's pairs be at least this lopsided toward concordant (or discordant)? Strictly, the test is of a population d of zero. Unrelated variables give a d of zero, but so can opposite ordering patterns that cancel, such as a rise and then a fall, so the test detects an overall directional association, not every kind of relationship. z uses the standard error worked out as if the population d were zero, and that makes z and p the same for both directions of d, the symmetric d and gamma. Below the conventional α = .05, the association is called statistically significant.
If attendance and satisfaction were unrelated, 180 students would give an ordering at least this lopsided, in either direction, about 0.3% of the time, roughly 1 in 330. That's below .05, so it's significant. A chi-square test on the same table, which ignores the order of the categories, gives p = .22 and misses it.
p is not the probability that the variables are unrelated, and it says nothing about how strong the association is or which variable is the predictor. That's what d, its interval and your design are for. Nor does a p above .05 mean the variables are unrelated.
Benchmarks p at a Glance
Strength of evidence against the null hypothesis.
Power and Sample Size
Power is the chance that a study detects an effect that's really there. A real association doesn't guarantee a significant result: with too few people, it can easily come out non-significant. For Somers' d, power depends on how strong the true association is, how many people you have, α, and how the people spread across the categories: when most of them pile into one band or one rating, most pairs are tied and carry no information.
Suppose, before collecting data, we expected a pattern like the one we found, a d of about .20, with students split across the bands as ours were. We simulated it: the attendance bands kept at our 2 : 4 : 3 split, each band's satisfaction ratings drawn from its own row of our table (which makes the true d exactly .20), and z = d ÷ ASE₀ tested at α = .05 two-sided, 20,000 samples at each size. About 165 students give 80% power (81%); our 180 had about 83%. Letting the band sizes vary from sample to sample gives the same answers within a point.
Researchers usually aim for at least 80% power. Plan it before collecting data, using the smallest association that would matter. There's no standard formula or calculator for Somers' d, so plan by simulation: write down the table of proportions you expect, draw many samples of a given size from it, and count how often z passes 1.96. As a rough check from a pilot or earlier study, multiply its n by (2.80 ÷ its z)²: for us, 180 × (2.80 ÷ 2.96)² ≈ 161, close to the simulation. Use it only as a rough check: a pilot's z is itself noisy, so plan on the smallest d that matters, not the pilot's. Halving d takes about four times as many people.
Other Info
Follow-Up and Post Hoc Tests
None needed. This test answers a single question, so there are no planned contrasts or post hoc tests to run.
References
- Somers, R. H. (1962). A new asymmetric measure of association for ordinal variables. American Sociological Review, 27(6), 799–811. https://doi.org/10.2307/2090408
- Goodman, L. A., & Kruskal, W. H. (1954). Measures of association for cross classifications. Journal of the American Statistical Association, 49(268), 732–764. https://doi.org/10.1080/01621459.1954.10501231
- Agresti, A. (2010). Analysis of ordinal categorical data (2nd ed.). Wiley. https://doi.org/10.1002/9780470594001
- Brown, M. B., & Benedetti, J. K. (1977). Sampling behavior of tests for correlation in two-way contingency tables. Journal of the American Statistical Association, 72(358), 309–315. https://doi.org/10.1080/01621459.1977.10480995
-
Newson, R. (2002). Parameters behind “nonparametric” statistics: Kendall's tau, Somers' D and median differences. The Stata Journal, 2(1), 45–64.
https://doi.org/10.1177/1536867X0200200103
“and is the parameter tested by a Wilcoxon test” (Section 4, pp. 51–52)
- IBM Corp. (2022). IBM SPSS Statistics 29 algorithms. IBM Corp. https://www.ibm.com/docs/en/SSLVMB_29.0.0/pdf/IBM_SPSS_Statistics_Algorithms.pdf
- Mehta, C. R., & Patel, N. R. (2021). IBM SPSS Exact Tests [Software manual, for version 28]. IBM Corporation. https://www.ibm.com/docs/en/SSLVMB_28.0.0/pdf/IBM_SPSS_Exact_Tests.pdf
- Cohen, J. (1988). Statistical power analysis for the behavioral sciences (2nd ed.). Lawrence Erlbaum Associates.
-
Muff, S., Nilsen, E. B., O'Hara, R. B., & Nater, C. R. (2022). Rewriting results sections in the language of evidence. Trends in Ecology & Evolution, 37(3), 203–210.
https://doi.org/10.1016/j.tree.2021.10.009
“we suggest language of evidence that allows for a more nuanced approach to communicate scientific findings as a simple and intuitive alternative to statistical significance testing” (Abstract)
-
McHugh, M. L. (2013). The chi-square test of independence. Biochemia Medica, 23(2), 143–149.
https://doi.org/10.11613/BM.2013.018
“The value of the cell expecteds should be 5 or more in at least 80% of the cells, and no cell should have an expected of less than one” (Assumptions of the Chi-square)
- Campbell, I. (2007). Chi-squared and Fisher–Irwin tests of two-by-two tables with small sample recommendations. Statistics in Medicine, 26(19), 3661–3675. https://doi.org/10.1002/sim.2832
Spot an error? Something still confusing? Tell us at support@statsforpsychology.com.