Case Study 2 — Younis Khan, Kane Williamson and the Venue Mix

A Test-cricket Simpson's paradox: how a decade without home Tests rearranged a great batter's record.

Setup

Ask any Test analyst for a quick way to compare two batters across eras and countries and you will probably hear: "look at their home and away averages separately." It is good advice. Home conditions help batters; a fair comparison should not reward someone for having played more at home.

But splitting is not the end of the story. When two batters have very different mixes of home and away cricket, the overall averages and the split averages can point in opposite directions. Chapter 6 called this Simpson's paradox and showed an IPL version (Rohit Sharma out-scores MS Dhoni in every phase but trails him overall). This case study is the Test-match version, and it comes with a piece of cricket history attached.

Imran Qureshi, who grew up in Lahore watching Pakistan's Tests on television and now runs analytics for a club side in Leeds, flagged it the moment he saw the search output.

Imran: Younis ahead of Williamson at home and away, but behind overall? That's not a bug. That's the UAE years. Count how many of Younis's "home" Tests were actually in Pakistan.

Narrator: The venue table classifies the UAE as neutral for Pakistan.

Imran: Exactly. So the data is telling the truth about where the matches were played. The question is whether "neutral" is the right label for what Pakistan's batters were doing in Abu Dhabi and Dubai for the best part of a decade.

The data

  • Source: men's Tests in the book's Cricsheet snapshot. Cricsheet's ball-by-ball Test coverage begins in December 2001, so the early part of Younis Khan's career is not included; everything below is "in the Cricsheet data", not his complete official record.
  • Venue status: toolkit/venues.py maps each match's city or ground to a host country and labels each innings home, away or neutral for the batting side. UAE grounds map to "UAE", which is neutral for every Test-playing nation.
  • Definitions: the book's standard batting definitions (batting_summary): average = runs / dismissals; balls exclude wides.
tb = add_home_away(load_deliveries("tests_male"), load_matches("tests_male"))
s = batting_summary(tb[...], by=["batter", "venue_status"]).reset_index()

Full script: code/case_study_02.py.

Analysis

Step 1 — The paradox, in full

Test batting by venue status (Cricsheet, from Dec 2001)
       batter venue_status  innings  runs  balls  outs  average  strike_rate
KS Williamson         home       93  5327   9636    81    65.77        55.28
  Younis Khan         away       87  3764   7565    78    48.26        49.76
KS Williamson         away       89  3440   7259    84    40.95        47.39
  Younis Khan      neutral       43  2161   4104    37    58.41        52.66
  Younis Khan         home       19  1210   2094    18    67.22        57.78
KS Williamson      neutral       13   748   1411    11    68.00        53.01
  Younis Khan: home + away only average 51.81; all venues 53.65; home share of home+away dismissals 19%
  KS Williamson: home + away only average 53.13; all venues 54.06; home share of home+away dismissals 49%

At home, Younis averaged 67.22 to Williamson's 65.77. Away, Younis averaged 48.26 to Williamson's 40.95 — a gap of more than seven runs. Pool home and away, and Williamson leads, 53.13 to 51.81. Add the neutral Tests and Williamson still leads, 54.06 to 53.65.

The mechanism is in the last column. Williamson made 49% of his home-plus-away dismissals at home. Younis made 19%. Both averaged far more at home than away (every batter in this comparison does), so the batter with more home cricket gets a pooled average tilted toward his easier subgroup.

Step 2 — Why so little home cricket?

Tests in which Younis Khan batted, by host country:
UAE             23
Sri Lanka       12
Pakistan        10
England          7
South Africa     7
Australia        4
New Zealand      4
Bangladesh       4
India            3
Zimbabwe         3
West Indies      3
Pakistan Tests hosted in the UAE (all players): 31, 2010–2018; in Pakistan 2010–2018: 0

Of the 80 Tests in which Younis batted in the Cricsheet data, 23 were in the UAE and only 10 in Pakistan. Across all Pakistan Tests, the data has 31 hosted in the UAE between 2010 and 2018 and none in Pakistan in those years. The public history is well known: after the attack on the Sri Lankan team's bus in Lahore in March 2009, touring sides stopped visiting Pakistan for many years, and Pakistan played its "home" Test series in the UAE. Pakistan's batters lost their home advantage for much of a decade; the UAE became a kind of adopted home, but our venue table — reasonably — calls it neutral.

Step 3 — A like-for-like comparison

The fix for Simpson's paradox is standardisation: put both batters on the same mix. With a 50/50 home/away mix:

Standardised to a 50/50 home/away mix: {'KS Williamson': 53.36, 'Younis Khan': 57.74}

On a level field, Younis's average is about 4.4 runs higher. Any common mix you pick will favour Younis, because he leads in both subgroups.

Step 4 — How sure are we?

Before declaring Younis "the better batter", apply the rest of Chapter 6. How much evidence sits behind each of those four averages?

95% innings-bootstrap intervals:
       batter venue  inns  outs  average  lo95  hi95
  Younis Khan  home    19    18     67.2  35.6 107.1
  Younis Khan  away    87    78     48.3  35.4  63.7
KS Williamson  home    93    81     65.8  50.8  83.1
KS Williamson  away    89    84     41.0  31.3  51.9

Left: grouped bars of Younis Khan's and Kane Williamson's Test averages at home, away and pooled, with 95% bootstrap whiskers on home and away. Right: stacked bars of each batter's dismissals by venue status — Williamson 81 home, 84 away, 11 neutral; Younis 18 home, 78 away, 37 neutral

📊 Figure (described): Left: Younis (blue) is ahead of Williamson (orange) at home (67.2 vs 65.8) and away (48.3 vs 41.0) but behind when home and away are pooled (51.8 vs 53.1). The whiskers show 95% bootstrap intervals; Younis's home whisker is enormous (36 to 107) because it rests on 18 dismissals. Right: the dismissals behind each average. Williamson's are split almost evenly between home and away; Younis's are dominated by away and neutral innings.

The home comparison is close to meaningless: Younis's home average rests on 18 dismissals and its interval runs from 36 to 107. The away comparison is more informative — 78 and 84 dismissals — but the intervals still overlap substantially (35–64 against 31–52). The standardised comparison inherits all of that uncertainty. The honest summary is: on like-for-like conditions, the Cricsheet-era data leans toward Younis, but not decisively.

Step 5 — Is this a one-off?

The chapter's search (script 05_simpsons_paradox.py, search 2) found 36 such pairs among the 216 Test batters with at least 15 dismissals both at home and away. The ten with the largest samples:

A_better_home_and_away B_better_overall  min_gap  overall_gap  min_outs
       FDM Karunaratne          D Elgar     0.74         0.05     140.0
             Azhar Ali       TWM Latham     0.33         1.82     118.0
              KL Rahul      JM Bairstow     0.33         0.98     115.0
            VVS Laxman DPMD Jayawardene     0.68         0.85     105.0
              MS Dhoni         T Bavuma     0.98         0.04     103.0
             Azhar Ali         T Bavuma     0.89         0.27     103.0
             Azhar Ali     F du Plessis     0.01         2.70     102.0
            Babar Azam    M Labuschagne     0.46         0.79      98.0
           Younis Khan    KS Williamson     1.46         1.32      96.0
           Younis Khan DPMD Jayawardene     4.14         0.57      96.0

Look at the left-hand column: Azhar Ali appears three times, Younis Khan twice and Babar Azam once — six of the ten largest-sample pairs have a Pakistan batter as the player who is better at home and away yet behind overall. That is exactly what the UAE years would produce: Pakistan batters of that era have unusually few home innings, so their pooled averages lean on their harder away cricket. The pattern is not unique to Pakistan (Karunaratne, KL Rahul, VVS Laxman and MS Dhoni appear too), and most of these gaps are small — fractions of a run in one subgroup — so many pairs are near-ties dressed up as paradoxes. The Younis–Williamson pair is the clearest because its smaller subgroup gap is 1.46 runs and its pooled gap 1.32.

What it means (and doesn't)

What it means.

  1. Overall averages compare careers, not batters. A pooled average answers "how many runs per dismissal did he make in the matches he happened to play?" — a question shaped by fixtures, home series and history as much as by skill.
  2. Splitting is necessary but not sufficient. Once you split, you must also put players on a common mix (standardise) before you compare totals.
  3. Context in the data can be historical, not just tactical. Pakistan's decade away from home is a real, measurable force in its players' records. Analysts comparing Pakistan batters of the 2010s with anyone else should account for it — and should decide deliberately whether the UAE counts as home, neutral or something in between.

What it doesn't mean.

  1. It doesn't prove Younis was better than Williamson. The intervals are wide, the data omits Younis's pre-December-2001 Tests, and "home" and "away" are themselves crude buckets (an away Test in Colombo and one in Brisbane are very different assignments).
  2. It doesn't make pooled averages useless. For "who scored more runs per dismissal in the Tests he played", the pooled number is the right answer. Simpson's paradox is about matching the statistic to the question.
  3. It doesn't say neutral venues are easy. Younis's neutral average (58.41 on 37 dismissals) is high, but an average for a different batter in the same venues could look very different; the UAE's conditions were their own thing.

Discussion questions

  1. If you reclassify Pakistan's UAE Tests as "home", do you expect Younis's home average to rise or fall from 67.22? Does the paradox survive? (Make a prediction, then do the Your turn task.)
  2. Williamson's home average (65.77) is far above his away average (40.95). Is that unusually large for a New Zealand batter? What conditions-based story might explain it, and what data would test it?
  3. Why does a 50/50 mix favour Younis and a 90/10 home-heavy mix favour him by less? Is there any common mix that would favour Williamson?
  4. Imran argues that the UAE was an "adopted home" for Pakistan. What evidence in the data could support or refute that — for example, how did visiting teams' batters fare in the UAE compared with Pakistan's own batters?
  5. How would you present this comparison on a broadcast graphic in a way that is honest about the 18- dismissal home sample?

Your turn

Reclassify and recompute.

  1. Copy code/case_study_02.py. After add_home_away, add a column status2 equal to venue_status, except that innings where the batting team is Pakistan and the host country is the UAE become "home".
  2. Recompute Younis's and Williamson's home, away and pooled averages under status2, with bootstrap intervals for each.
  3. Does the paradox survive? Report the new home share of Younis's dismissals and his standardised (50/50) average.
  4. Extend the search: run the Simpson's-pair search from code/05_simpsons_paradox.py (search 2) under status2. How many of the original 36 Test pairs disappear, and how many involve Pakistan batters? Write 200 words on what the venue label does to cross-era comparisons.