Friday, 25 August 2017

Over too quickly

The English test summer has been a summer of thrashings. Not only the one-sided day-night affair at Edgbaston last week, but also the South Africa series finished without producing a single game which you would really call close.

This is not something terribly unusual. Large margins of victory are the norm in test match cricket, even if the two teams competing are fairly evenly matched, as has been noted previously on this blog.

There has been another common feature of these games- related to, but separate from, the comfortable victory margins: the outcome was highly predictable once both teams had batted once. The first innings leads in England's home games of 2017 have been: 97, 130, 178, 136 and a whopping 346.

With these leads duly established, the side ahead has remained more-or-less in control for the remainder of the game.

This observation prompts today's blog topic: how frequently are modern test matches virtually decided by the time both teams have batted once?

The pie chart below shows the distribution of first innings leads in tests since 2013. This amounts to a sample of 194 tests (I discounted a few which didn't get as far as two complete innings)

As you can, see more than a third of games feature first innings leads greater than 200 runs, and around half of all games feature leads greater than 150 runs. As you would guess, a lead of 150 runs is pretty determinative. The chart below shows the outcome of those games since 2013 with a first innings difference above 150: the first innings leader won 86% of the time with all the rest being draws, apart from one- Sri Lanka's miraculous victory against India at Galle in 2015


So around half of modern test matches really are basically over once each team has batted once- perhaps taking you up to the early to mid stages of day 3 with any real doubt about the destination of the game. You may wonder whether the qualifier "modern" was really necessary in that last sentence. Perhaps it was ever thus. People often like to tell you that the past was better, but people are often wrong.

I haven't attempted an analysis of first lead innings over the entire history of test cricket, which is what I would have liked to do. Unfortunately, I wasn't clever enough to find a time-efficient way of gathering the data on first innings leads (statsguru doesn't have a button for that). But to provide a bit of historical context for the data above, I homed in on the data for a 5 year period in the late 90s, by way of comparison with the modern day. I chose this period for no better reason than that it was the time I first got into cricket and I feel nostalgic about it.

The data from 1995-1999 support the theory that tests were not quite so frequently decided early in those days, as you can see below.



Only around a third of games saw first innings leads above 150 runs, and nearly a quarter were within 50 runs on first innings (as an aside, games with sub 50 run leads are basically toss-ups, both in the 90s and now- dividing roughly evenly between the leading side, the trailing side and the draw). 

In games which did feature a big difference on first innings the distribution of outcomes were basically the same as they are now- so teams weren't necessarily better at responding to a large deficit, but large deficits weren't quite so frequent. 

Test cricket is a wonderful sport, but I think it must be admitted that one of its weaknesses is that it very easily produces one-sided games which are over long before they are over. This has probably always been the case to some extent, but it would appear to have become exacerbated of late. Proposed explanations and solutions for this may vary. When a truly nail-biting test match comes along, uncertain to the end, treasure it for the previous jewel it is.




Sunday, 4 June 2017

Approaching the milestone

During England's eventually successful chase of 306 to beat Bangladesh in the opening game of the Champions Trophy, Alex Hales was on his way to a hundred. He'd just started to take a fancy to the bowling of Sabbir Rahman and biffed a couple of boundaries to move to 94. Swinging for the fence once more he was caught at deep midwicket.

Of course, this was a cause of exasperation for some English observers but George Dobell - one of my favourite cricket writers- took a different view, tweeting:

Dobell is suggesting - and for what its worth I broadly agree- that whatever you think of the selection and execution of the shot, Hales' attitude was admirable. Rather than play steadily through the 90s to try and guarantee himself the milestone and associated plaudits, he judged that it was better for the team if he carried on accelerating, and was willing to risk the personal achievement of notching another ODI hundred for the good of the team.

The tweet also seems to allude to a converse attitude among many of Hales' peers- that many of them do slow down as they approach 100, for the sake of trying to make sure of getting there. In today's blogpost I want to examine that idea amongst modern ODI batsmen.

Is it really common for ODI batsmen to noticeably slow down as they approach 100?

If so, how much do they slow down? How much innings momentum is lost to milestone hunting?

In an attempt to answer these questions I have had a look at the ball by ball data for all of the ODI centuries scored between the beginning of 2016 and the England v Bangladesh match the other day (so the data doesn't include Kane Williamson and Hashim Amla's centuries in the last two days).

This adds up to 108 centuries. I divided them each up into windows of 10 runs (0-9; 10-19 etc) and asked how many balls each batsman spent with their score in each window. If batsmen are tending to slow down as they approach 100, we should see that they spend more balls in the nineties than in the 70s or 80s.

The graph below show the average result for each run window, averaged over the 108 centuries in the sample. The red line is the mean, the blue line is the median.

One feature of the graph which I like- which is basically irrelevant to today's question but I'll mention it all the same- is that does give a nice visualisation of the batsmen playing themselves in. The first 10 runs really are noticeably slow compared to the rest of the innings, taking an average of around 14 balls. Thereafter, the average ODI centurion stays close to the run a ball mark, with gentle acceleration over the course of the innings. The average number of balls taken to get through a 10 run window goes from 10.09 in the twenties down to 8.27 in the 80s.

The brakes do seem to go on just a little bit in the 90s however, with the average balls taken for those 10 runs ticking back up to 9.23. (The median goes up to 9 from 8).

So, the data is a consistent with a weak slowing down as batsmen get near the milestone. But its a very tiny effect. Indeed the size of the effect is comparable to the degree of statistical noise in the data, so I'm not even 100% sure its real. But, if we take it at face value, batsmen are on average spending about 1 ball longer in the 90s than they are in the 80s, possibly influenced by the impending glory of an ODI hundred.

To look at the data a different way: 56% of the centurions were slower through 90s than they were through the 80s. By way of comparison only 38% were slower through the 80s than the 70s. Again this is consistent with the expected steady acceleration through the innings, which is very slightly waylaid by a nervous nineties slowdown. The distributions for the number of balls taken to get through the 80s and the 90s are plotted below as histograms. Comparing them you can see a slight rightward shift of the distribution as you go from 80s to 90s.




An extra one ball to score 10 runs is very small potatoes, so you probably don't need to be too worried that this is going to cost your team a match. Of course, for some individuals the effect may be stronger. And still, its interesting to reflect that even the top pros may be affected by the arbitrary milestones made for them, even if just by a tiny bit.

Sunday, 5 February 2017

Double the score at 30 overs

At some point during the display of pure swashbuckling, boundary smashing, batsmanship that was the recent India vs England ODI series something caught my eye. Well, several things did, but only one directly inspired this blog post. It was a someone on twitter estimating what the batting team's final total would be, using the rule-of-thumb that it will be roughly double the score at 30 overs.

In my head, my reaction went something like this "Really? People are still using the 'double the score at 30 overs rule'? Surely that's way out of date now, if ever it was true." 

I then continued thinking: "I bet modern batsmen, with their skills honed to play aggressively, playing on flat pitches with short boundaries probably consistently beat that mark these days".

Well, the data shows my snide internal monologue was wrong, as you'll see below. To be honest, a moment's further thinking would have revealed my prediction to be hopelessly naive (not to mention cliche-ridden)- if team's are now scoring faster in the later overs, they're also scoring faster in the early overs. So, how it ends up working out for the "double the score at 30 overs" rule isn't immediately obvious.

In fact, in recent ODIs, if you estimate a team's total by doubling their 30 over score, you will be quite consistently too generous.

The graph below plots the ratio of the final total to the score at 30 overs achieved by teams batting first in (non-weather affected) ODIs since the beginning of 2016, against the number of wickets fallen at 30 overs. Points above the green dashed line represent innings which beat the benchmark of twice the 30 over score, points below the green dashed line fell short of it. The red line is the median ratio as a function of the number of wickets down at 30 overs, just to give a sense of how much it depends on how many batsmen are back in the pavilion.


As you can see, there are many more points below the green dashed line than above it. To be precise,  sides batting first fall short of that mark 74% of the time. Even sides who are only one or two wickets down at 30 overs fall short of doubling their score more often than not.

The "double the score" heuristic is still not too bad as a ballpark figure, which I guess is all its meant for- the average ratio between the 30 over score and the final score was 1.81. Nevertheless, it is a fairly consistent overestimate. If you want a rule-of-thumb which is still somewhat simple, but a bit less over-generous "double the score and subtract 10%", might be better.

One might then wonder, how this plays out for teams batting second. Is a chasing side that's only halfway to the target at 30 overs likely to win?

The answer is: no, they are not. Chasing teams that are around halfway to their target at 30 overs usually lose.

The graph below plots, for each ODI chase since the beginning of 2016  (again, in non-weather-affected matches),  the fraction of the target achieved at 30 overs against the number of wickets fallen at that point. Red points represent winning chases, blue points represent losing chases.



The dashed green line is the threshold of being halfway to the target at 30 overs. You'll notice that teams on the edge of this threshold rarely win and that teams below it never do. (I say never- of course I just mean within the sample I studied- I'm sure there are plenty of examples if I had gone back further).

The bottom line is that a chasing team, who at 30 overs is only halfway there, is very much livin' on a prayer.





Wednesday, 21 December 2016

Jennings, Hameed, Duckett .... and Bayes?

As the umpires of time take off the bails of 2016, and as the England team pick themselves off the mat after an absolute hammering from India, I bring you this year's festive look at the data. It's...a bit different.

England's test tour of Bangladesh and India featured the introduction of three new batsmen into test cricket. Keaton Jennings and Haseeb Hameed have been singled out as definite bright spots of the tour, while Ben Duckett may have to wait a little while for his next opportunity. But how can we sensibly assess each one's tour? And how likely is it that each one will be a medium-to-long term success at test level?

Things like this are difficult. Whenever a new player is picked, nobody- not the fans, not the selectors, not the player themselves- knows with certainty how it's going to go. Some demonstrably very talented players don't succeed in the long run, and some apparently more limited ones do and it isn't always obvious why. As a player starts out in test cricket (or at any new level or form of cricket), we must acknowledge that there are range of possible "outcomes" for their career- they may later be remembered as a legend, an unfulfilled talent, an "every dog has his day"... we just don't know.

But over time, we find out. With each fresh innings we see more of them, and gradually our uncertainty morphs into knowledge. A couple of years ago, I don't think it was enormously obvious which of Joe Root and Gary Ballance would be the better test player. Now, however, I think have a certain degree of confidence about the answer to that.

This is, in essence, a problem of forecasting. We have data about the past and we want to make a (hopefully, educated) guess about the future. Which of two players will be better? With each new data point, we update our forecast and hopefully arrive closer to the truth*.

There's a famous theorem of mathematics- called Bayes theorem, after Rev. Thomas Bayes, which we can use to do exactly this. As an equation it looks like this:



For our purposes: 'B' is something I have observed (e.g.  "Keaton Jennings scoring a century"). 'A' is the thing I want to find out the probability of being true (e.g. "Keaton Jennings will be a long term success at test level").

P(A|B) is the thing I want to know. It is the probability that A is true, now that I know that B is true.
P(A) is the "prior"- the probability I would have given to A being true before I knew that B was true.
P(B) is the probability of B happening without regard to whether A is true.
P(B|A) is the probability of B happening assuming A is true.

Let's try and apply this to England's new recruits, albeit in a slightly crude fashion.

To begin, let's suppose four possible long to medium term outcomes for a player's test career:

1) Very good
2) Good
3) Okay
4) Not so good

Let's now consider all the batsmen who made their debut for England batting in the top six between 2000 and 2014. (I cut it off at 2014 so as to have reasonable some chance to say how their career went after their debut).

We'll exclude Ryan Sidebottom from the sample because he was there as a nightwatchman, and Chris Woakes because I think most people would say he's mainly a bowler, leaving us with 22 players.

Ranking them by batting average and dividing the list according to the categories above, I would say they break down something like this (*controversy alert!*):
Group 1 ("very good")- Cook, Pietersen, Root
Group 2 ("good") Barstow, Bell, Strauss, Trescothick, Trott
Group 3 ("okay") Ali, Ballance, Collingwood, Compton, Stokes
Group 4 ("not so good") Bopara, Carberry, Clarke, Key, Morgan, Robson, Shah, Smith, Taylor

This gives us our initial values for P(A) in the Bayes theorem equation. For a generic England debutant batsman in the modern era:
P(very good)=3/22=13.6%
P(good)=5/22=22.7%
P(okay)=5/22=22.7%
P(not so good)=9/22=40.9%

We then want to know the probability for a player belonging to each of these groups to have a given outcome from one innings. We'll categorise the outcomes of an innings pretty crudely:  0-9. 10-49, 50-99, 100-149, greater than150.

Based on the records of the players listed above we can estimate the probability that (e.g.) a player belonging to Group 2 ('good') will score between 100 and 150 in any given innings. The table looks something like this:



Obviously, the best players are more likely to get high scores and less likely to get low scores. But crucially there's a finite probability for any innings outcome for any group of player. This actually gives us all the information we need to take one innings outcome for a player and use Bayes theorem to generate a new forecast about the probability that they belong to each of our four categories.

So, let's take the example of Keaton Jennings. Before he batted, I though of him as just a generic debutant and my forecast about his ability at test level looked this:

P(Jennings is very good)=13.6%
P(Jennings is good)=22.7%
P(Jennings is okay)=22.7%
P(Jennings is not so good)=40.9%

After he scored a hundred, applying Bayes theorem gives:
P(Jennings is very good)=16.8%
P(Jennings is good)=26.8%
P(Jennings is okay)=23.5%
P(Jennings is not so good)=32.9%

So the odds I would give to him turning out to be a very good player after the fashion of Root, Cook or Pietersen went up after his hundred, but only modestly. It's still only one data-point after all, and the fact remains that most batsmen don't turn out to be a Root, Cook or Pietersen.

He then got two low scores and a fifty. Applying the process iteratively we end up at:

P(Jennings is very good)=14.2% 
P(Jennings is good)=28.0%
P(Jennings is okay)=24.3%
P(Jennings is not so good)=33.4%

So there's still a high degree of uncertainty. Relative to before his debut the probability that things won't work out is down and the probability that he'll turn out to be great is up. But only modestly. We don't know much.

For Hameed and Duckett we can do the same thing with their results on tour.

Hameed is in a similar boat to Jennings. The probability that he'll be a long term success is up, but only modestly. We'll have to wait to be sure.

P(Hameed is very good)=18.0% 
P(Hameed is good)=28.7%
P(Hameed is okay)=23.2%
P(Hameed is not so good)=30.1%

For Ben Duckett, the outlook is a bit poorer. Our calculation now gives over a 50% chance that he'll be in the "not so good" category and a less than 10% chance that he'll be in the "very good" category. Specifically:

P(Duckett is very good)=7.3% 
P(Duckett is good)=17.2%
P(Duckett is okay)=23.1%
P(Duckett is not so good)=52.4%

Still, though, the calculation calls us to be circumspect. We have some indications about Ben Duckett's test prowess, but not the full picture. A nearly 25% chance that he'll turn out either good or very good is far from nothing.

There are two things I like about this way of thinking. Firstly, it allows us to acknowledge the world's inherent uncertainty without throwing up our hands and giving up. We can't have absolute certainty, but we can have some idea. Secondly, it gives us a mechanism to build new information into our thinking, to update our view of the world as we get new information.

The calculation I've outlined above is clearly much too crude, and leaves too much out to be used for selection purposes. But I genuinely think this way of thinking- i.e. probabilistic and updating forecasts based on new information- is well suited to this kind of thing. "Keaton Jennings will open England's batting for years to come" is too certain a statement for a complicated and uncertain world. Maybe, "there's a 42% chance that Keaton Jennings will turn out to be at least as good as Marcus Trescothick" is closer to the truth.


* There's a really nice book about statistics and forecasting called "The Signal and the Noise" by Nate Silver. It doesn't mention cricket, more's the pity, but it covers many fields- from baseball to finance to earthquakes-  where some kind of forecasting is desirable and looks at why some of these areas have seen great successes using statistical methods and others have seen catastrophic failures. It's very readable and I very much recommend it if you're into that sort of thing.

Saturday, 20 August 2016

One remarkably consistent aspect of test cricket

It seems that James Vince and I have at least one thing in common: despite starting the season full of high hopes, neither of us have had a very prolific summer. I haven't blogged much of late, and indeed I haven't paid as much attention to England's test summer as I normally would, due to various other things that have occupied my time and brain space. This is a shame for me, because the series with Pakistan seems to have been a great one, judging by the bits of coverage I did catch.

In today's return to the statistical fray, I was interested to have a look into how the relative importance of different parts of the batting order has changed over time in test cricket. For instance, it is a well worn claim that tail enders are better batsmen than they used to be- does this mean teams now rely on them more for runs compared to other parts of the team? England have relied heavily on their lower-middle order of late- is this part of a trend or just how things are in one team right now?

To get a sense of this I divided the batting order into 4 parts: openers (1-2), upper middle order (3-5), lower middle order (positions 6-8) and tail (9-11) and looked at the percentage of runs off the bat each part of the order contributed in tests in each year since 1946.

I don't want to undermine my own blog too much, but the result was the most strikingly featureless dataset I have ever written about- as you can see in the graph below. The points show year by year data and the lines show 10 year averages.

Consistently, openers get about 26% of the runs, positions 3-5 get about 41%, numbers 6-8 get 25 % and the tail about 8 %. This has barely changed at all in the last 70 years.

The one small trend you can pick up is that the gap between openers and the lower middle order closes over time from a position where openers were contributing 3-4% more than numbers 6-8
up until the present day when the two contributions are basically equal (openers 25.3% vs lower middle 25.7 % over the last 10 years). This change is consistent with the increased batting role of wicket keepers which we discussed in the last post. There is a big uptick in the lower middle order data just this year, that stands out as rather an outlier- this part of the batting order has made 32.7% of the runs 2016, several percentage points above the long term average. This is in large part driven by England's reliance on that part of the line up- fully 42.6% of England's runs off the bat have come from numbers 6-8 this year. I expect the global figure (and probably England's too) will regress to the mean a bit before the year is out.

Positions 3-5 consistently provide the biggest slice of the run scoring pie. The difference between their contribution and the openers is a couple of percentage points larger than can be explained by the fact there's simply one less player in the openers category. This is consistent with the notion that teams tend to put their best batsmen somewhere between 3 and 5.

Batsmen 9-11 meanwhile, for all the talk of improving tail enders, have chipped in with about 8%  of the teams runs extremely consistently all this while and show no signs of changing.

Plus ca change, plus c'est la meme chose.


Thursday, 26 May 2016

Charting the evolving role of the wicketkeeper

Last week's test between England and Sri Lanka belonged to Jonny Bairstow. A century on his home ground and a match winning one at that- rescuing England from 83-5 and dragging them to a total out of the reach of Sri Lanka's callow batting line up. Behind the stumps in his role as wicketkeeper he took 9 catches, making it an all round good 3 days at the office.

Bairstow is an example of what would seem to have become a pretty established pattern for the modern test match side: picking your wicketkeeper with a heavy emphasis on their willow-wielding ability, and a lesser focus on their glovemanship than might have been seen in previous generations. I don't think I'm going too far out on a limb to suggest that Bairstow is not the best pure wicketkeeper available to England, but out of the plausible  keeping options he's the best of the batsmen, at least for the longer format.

This has made me wonder: how much has the wicketkeeper's role evolved over time? How much more are teams relying on their keepers to score runs? And has an increased emphasis on the batting prowess of keepers had a measurable cost in their performance behind the stumps?

The simplest thing to think would be that picking keepers based on their batting would come at a price in catches and stumpings. But can this be seen in the data?

I particularly enjoyed researching this post, not least because answering those questions will take not one, not two, not three but four graphs.

First of all, the run scoring. The graph below shows the run scoring output of designated  wicketkeepers, as a percentage of total runs scored by batsmen in tests from 1946-2015. The red points are the year by year data and the blue line is the decade by decade average. The decade by decade averages give you a better sense of the long term trends.




This data shows a clear evolution towards a greater dependence on wicket keepers to provide runs. Wicket keepers provided only 6% of runs in the immediate post-war period, but they now provide nearly 10%. This is, of course, very much in line with conventional wisdom. One thing that struck me, however is how steady this increase has been. I had expected to see a rather more dramatic increase in the 90s and early 2000s after Adam Gilchrist made the swashbuckling batsman-keeper cool, but the importance of the wicketkeeper's runs had been rising steadily for a while (with a bit of a dip in the 1980s).

But what of their behind the stump performance? If teams' enthusiasm for batsman-keepers is leading to a lower standing of keeping, one might expect that to be reflected in how wickets are taken. If keepers are worse than they used to be then perhaps modes of dismissal which depend on them- catches behind and stampings- will decrease relative to other, non-keeper dependent, modes of dismissal.

The next graph shows the percentage of total wickets that were catches by the keeper in tests from 1946-2015. (Again, red points=year by year, blue line=decade by decade)



Far from decreasing, the reliance on wicketkeeper catches to provide wickets increases steadily post 1946- over the same period that keeper run scoring was on the rise- before hitting a plateau around the 1990s. Modern wicketkeepers provide about 19% of the total wickets through catches, and that figure has shown any noticeable downward shift since keepers have been expected to provide more runs. It may well be that what this graph is telling us has most to do with the evolution wicket keeping and bowling styles rather than keeping quality, but in any case its true that modern teams rely on wicket keepers both for more runs, and for more catches than teams 70 years ago. As the responsibility of keepers has increased their responsibility as glovemen has not diminished at all.

Wicket keepers can also contribute to dismissals via stampings. This is a much rarer mode of dismissal than caught behind but, we some may argue its a truer test of wicket keeping skill. The graph below shows the percentage of wickets that were stumpings over the same period as the graphs above.



The contribution of stumpings to the total wickets decreases in the post war years- over the same period that the contribution of catches increase (perhaps reflective of a decrease in standing up to the stumps? I'm not sure). But it's held steady between 1.3% and 1.9% for the last 50 years. So, wicket keepers continue to hold up their end in whipping off the bails.

If we can't see any strong changes in wicket keeping contributions to wickets, what about other ways of measuring wicket keeping quality? Byes, for instance. The graph below shows the number of byes conceded per 1000 deliveries in test cricket from 1946-2015.

The rate of conceding byes has hardly changed in 70 years. Looking at the decade by decade trends you could argue that it was on a steady decrease up to the 90s before taking an uptick, but these changes are miniscule- corresponding to maybe 1 extra bye conceded in a 1000 deliveries.

So, while its clear that more runs are indeed required of the modern keeper, the expectations behind the stumps have not shifted that much. Keepers contribute a consistent ~19% of wickets through catches with an additional ~1.5% through stumpings. They concede about 7 byes per 1000 balls and have barely budged from that for 70 years. Considering that the expectations on their batting have increased, while they have remained steady in other aspects of the game, keepers arguably have more on their plate than ever before.



Monday, 16 May 2016

Reverse Swept Radio

This week I had the pleasure of being interviewed by Andy Ryan on the excellent Reverse Swept Radio podcast. If you would like to hear me talk about cricket, stats and this blog, the link is here:

http://reversesweptradio.podbean.com/e/rsr-81-a-cricket-podcast/

Friday, 13 May 2016

How much more valuable are first division runs?

England announced their squad to play Sri Lanka this week, with Hampshire's James Vince getting the nod to take up the middle order slot unfortunately vacated by James Taylor. Nick Compton, meanwhile, keeps his place at number 3, at least for the time being. Essex's Tom Westley, who has had a productive start to the season and has been much talked up, was left out (I was hoping he would be picked, but not for any cricketing reason- I just wanted the opportunity to make some Princess Bride jokes).

As England squad selections draw near, with places up for grabs, attention often turns to the county championship averages. One of the few things everyone seems to agree on at this point is that runs made in the first division of the championship should be valued more highly, being made against higher quality attacks. This seems eminently reasonable, but raises a question: how much more valuable are they? Can we make the comparison quantitative?

I'm going to have a go.

What we want is to take a sample of batsmen who played in both divisions in successive seasons and ask, on average, how much did their run output drop/rise on switching divisions. Such a sample is provided to us by the championship's promotion and relegation system.

What I've done is go through the county averages for all the completed seasons since 2010, looking at the performance of players in teams that were relegated or promoted and then comparing their season's batting average before and after the change of divisions. (So, for example, I took the batsmen who played for Kent in division 1 in 2010 and compared each batsman's average to what they managed in division 2 in 2011).

I only included batsmen who played at least 10 matches in both seasons. The results are depicted in the graph below. The batting average in division 2 for each batsman in the sample is one the x-axis, with division 1 on the y-axis. Players in relegated teams are in red, promoted teams in blue. Points below the black line averaged higher in division 2 than division 1, and above vice versa. The green line is the best linear fit to the data.

Of the 81 players in the sample, 52 averaged higher in division 1 and 29 averaged lower. So, the intuition that runs are harder to get in division 1 seems solid, as expected. But how big is the difference?

Well, on average the relegated players in the sample increased their averages by 4.98 runs on going from division 1 to division 2. The promoted players saw their averages drop by an average of 7.12 runs on going from division 2 to division 1. So based on those numbers the difference is moderate but noticeable- able to turn a "very good" set of numbers into merely "good" ones and "good" into merely "acceptable".

The linear fit which I attempted (which should be taken with absolute ladelfulls of salt) gives:

average in div 1=28.2 + 0.12 * (average in div 2)

so it would predict a player who averages 50 in division 2 to average only 34.2 in division 1. (As I say, don't take this equation too seriously, and possibly not seriously at all, not least since it predicts that players averaging less than 32 in div 2 should be expected to do better in div 1).

There is a chance that the difference between divisions is exaggerated in this data by a selection bias. Specifically, looking at players who were promoted from div 2 or relegated from div 1 may bias the sample towards players who under-performed their "true" ability when in div 1 or over-performed in div 2. In this case the shift in batting averages may in part be a case of regression to the mean, on top of the real change in the difficulty of run-getting.

This caveat notwithstanding, the difference in divisions seems quite considerable, and division 1 runs are worthy of their additional praise.

Thursday, 5 May 2016

The candidates

Despite its title, this is not a surprise post about the extraordinary political wranglings currently in full swing in the land of baseball and chilli-dogs. No, this will be about the far weightier matter of whether certain batsmen are especially susceptible to being pinned LBW, and who those current players are.

In cricket commentary, it's common for players whose technique looks somehow prone to leave them trapped in front of their stumps to be described as "lbw candidates". This terminology seems to be applied specially to that particular means of dismissal- batsmen are rarely described as "caught behind candidates".

The questions I want to investigate in today's post stem from this.

Firstly, is "lbw candidate" a worthwhile category- is there a substantial subgroup of modern test batsmen who are especially more lbw prone than their peers?

Secondly, who are these prime candidates in the post-Shane Watson era? I've often heard Alastair Cook described as a "candidate". Does he deserve the title?

We'll also be touching on where in the world lbws are most prevalent.

To tackle this, I took a sample of 45 current test match players, representing all the test nations apart from Zimbabwe, who haven't had much opportunity to play recently. The sample was obtained by taking the most recent test for each nation and including all the batsmen in he top 7 who had played at least 15 tests and who weren't obvious night-watchmen. For each player I looked up the total number of LBW dismissals in their test career and divided it by the number of dismissals overall. This is what is on the x-axis of the graph below, with the batting average of each player on the y-axis. The colour/shape of each point indicates the country for which the batsman plays.

The black dashed line is the sample median (0.155) and the red dashed lines either side are the upper (0.187) and lower (0.125) quartiles. As you can see, the data is quite clustered horizontally suggesting only a fairly small degree of variation in vulnerability to LBW amongst current test batsmen. There's also no significant correlation between the LBWs/dismissal and the batting average, suggesting that having a high proportion of dismissals be LBW doesn't indicate much either way for a batsman's run scoring ability.

There are, however, a few noticeable outliers, far removed from the central cluster to whom we now come:


  • The Shane Watson memorial award for excellence in attracting LBW decisions (I like the idea of this award- we could call it the "iron pad" and award it annually) goes to South Africa's JP Duminy, who is way off to the right of the graph with 39% of his dismissals being LBW. (A lot of these were against spin bowlers).
  • There's a select trio of players to the left of the graph who hardly ever get pinned LBW. Namely Pakistan's Sarfraz Ahmed (0 lbws/28 dismissals), England's Ben Stokes (1/41) and Bangladesh's Tamim Iqbal (2/79). It may not be significant but these are all quite aggressive batsmen, so perhaps more than being good at avoiding LBWs, they're finding other, more exciting, ways to get out first.
  • There's a foursome of Pakistan players separated from the main cluster, at around 0.25 LBWs/dismissal. These are: Younis Khan, Misbah ul Haq, Asad Shafiq and Mohammed Hafeez. It's tempting to wonder whether this might be because they play a lot of tests in the UAE, where the low, slow pitches are thought to be favourable for LBWs. Indeed, in the graph below you can see that the UAE does have the highest rate of LBWs per dismissal of top 6 batsmen amongst test match hosts since 2010. However, this probably doesn't fully account for it- if we exclude tests in the UAE for these four players only Hafeez sees his percentage of LBWs drop significantly.


Overall, modern test batsmen don't vary too much in how frequently their pinned leg before, with a small number of exceptions. For what it's worth, Alastair Cook falls close to the central cluster of data points in our first graph, albeit slightly on the high side, with a rate of 0.19 LBWs/dismissal. And with Pakistan's apparently quite LBW prone top order coming to England this summer, it could be quite a good season for the thump of ball on pad, and the slowly raised finger. Maybe.

Saturday, 16 April 2016

Throwing out the form book?

So it's been quite a while since I posted anything here, but with the thrill of a new English cricket season upon me, I'm strapping on my pads of data, taking up my bat of analysis and striding out to the wicket of the internet.

As I scratch around, hoping to hit a bit of early season form, I'm going to attempt some rudimentary analysis of exactly that concept- "form". The point of this blog is meant to be try and hold up some of cricket's hoariest old cliches and nuggets of received wisdom to the light of some data. The idea of being "in form" is surely one of the foremost such cliches in cricket- perhaps in all of sport.

The eseential claim is this: a player is more likely to perform well at times when they have performed well in the recent past. A player who has performed well recently is usually said to be "in form".

The explanations for this tend to hinge on a player's confidence being high when their recent performances have been good. Or people may speak about players "being in a good rhythm", or "in a good place".

But to what extent is "a run of good form" distinguishable from a run of good luck? You sometimes hear commentators say something along the lines of:

"when you're in good form, it's amazing how the little bits of luck start going your way as well- playing and missing rather than nicking it,  balls in the air going between fielders rather than to them..."

At which I might want to say to them: "Is it amazing? Is it though? Or is it just that you only assign players the property of "good form" when they happen to be on a good run of scores- which requires a certain amount of luck?".

I'm not going to attempt a full analysis of whether form is a "real" phenomenon- in the sense of being meaningfully predictive of future performance- in one blog post. Although I may come back to different aspects of the question later.

I do, however, have some data to show which impacts on this question and I think it's interesting.

To make the question narrower, and therefore more tractable, I asked: "are test match batsmen more likely to score a century when they have already scored a test century in the last month?"

To answer this, I looked at the careers of the 23 most prolific test match century scorers in history. I did this because I needed a sample of players who had scored enough centuries that one could meaningfully compare the games when they hadn't scored one recently, with games where they had. Obviously, this does introduce quite a big selection bias- it's possible that the results I obtain may only be applicable to those players at the very top of cricketing history's tree. So be aware of that when you decide what to think of the results.

The graph below shows the rate of century scoring per match in games within a month of having previously scored a century against the total number of centuries scored per match for each player.
Points above the blue line represent players who had a higher rate of century scoring when they had recently scored a century and those below the blue line represent players who had a lower rate of century scoring when they had recently scored a century. The lone point way off to the top right of the graph is, of course, Sir Donald Bradman.

As a group these batsmen scored an overall total of 723 centuries in 2945 games- a rate of 0.246 centuries per match. In games within a month of having scored a test century my research puts them at a total of 182 centuries in 704 games- for a nearly identical (but slightly higher) rate of 0.258 centuries per match. On an individual level 11 of the players were more prolific when they'd recently hit a hundred and 12 were less so. For most players the difference was minor, as indicated by the fact that most points in the graph fall fairly close to the blue line.

There isn't enough evidence here for me to boldly claim that form makes no difference to batsmen. But it does suggest that form doesn't matter as much as you might imagine, at least for this sample of batsmen who belong among history's greatest.

For those out of form I would say this: take heart- form is an ephemeral thing which can return as suddenly as it departs. And maybe it doesn't matter so much whether you have it or not.

Friday, 25 December 2015

Festive Tidings and the Exceptional AB de Villiers

Today, I bring you a festive look at the data! I mean, not that there's anything particularly Christmassy about the content of this blog post- but hey, it's Christmas, there are mince pies in the oven and I'm writing about the batting statistics of wicket keepers. To me, that's festive.

This time around, the piece of cricketing received wisdom coming under the microscope is the belief that when a batsman who's able to keep wicket has to do so, it impacts negatively on their run scoring ability. The most famous (and, not coincidentally, also the most extreme) example of this is Kumar Sangakkara who averaged an acceptable 40.48 when playing as a wicket keeper and a stellar 66.78 when playing as a specialist batsman. It seems reasonable to believe that the physical and mental strain of long periods of wicket keeping would make run scoring harder, but the same could be said of the pressure of the captaincy- and we saw in the last post that captaincy actually seems not to generally make so much difference to run scoring output.

I actually prepared the research for this post a while ago, but didn't write a post on it because- as you'll see below- there isn't so much to work with in this case, and I worried that there wasn't enough numerical meat to make a satisfying analysis. However, the issue came up on the superb Switch Hit podcast this week- in the context of AB de Villiers' stewardship of the keeper's gloves for South Africa- and I thought that since it's an interesting question, I might as well write it up. Decide for yourselves whether the data justifies the conclusions.

So, what we want to do is take some test match players who've played a decent number of tests both as wicket keeper, and as a specialist batsman and compare their batting averages in those two sets of games. The problem is that there are very few players who fit that description. Specifically, I could find only seven players who played both at least 10 tests as the designated wicket keeper and at least 10 not as the wicket keeper. That rather select club is listed in the table below

In the graph below, I've plotted the batting average when playing as keeper against the average when not playing as keeper for each player. Players falling below the blue line have worse averages when playing as wicket keeper and those above have better batting averages when granted the gloves.

Seven players isn't much to draw a conclusion from but nevertheless, the evidence in this case weighs in favour of the received wisdom- it does seem that having to keep wicket depresses a batsman's average. Of our seven players 2 have better averages when playing as keeper and 5 do worse. That in itself could easily just be chance, but what's more notable is the players who are doing worse as keeper tend to be doing rather a lot worse, suggesting that there is a potentially rather a strong effect at play. The average difference between averages when keeping and not our sample was -10.19 runs- less extreme than Sanga's -26.3 but a pretty big difference all the same.

Which makes AB de Villiers' bucking of the trend all the more special. He averages fully 8.83 runs higher when keeping. Of course, this won't necessarily last. It's quite possible - maybe even likely - that if he stays as South Africa's first choice gloveman for a couple more years his average as keeper will regress back in line with his average when not keeping - or even below. Or perhaps - as he has in many other ways - de Villiers will prove to be exceptional in the truest sense of the word.

I want to finish this post by thanking you all for reading and to particularly thank Chris of the excellent blog "Declaration Game" for kindly promoting my blogging over the last 6 months. I was honoured to be included in his "Select XI" blog posts of the year, which if you haven't seen it yet is well worth a look- providing a very broad cross section of some extremely interesting cricket writing.

Merry Christmas!

Sunday, 15 November 2015

Batsmen and the burden of the captaincy

It must be tough being a test match captain. The potential for days in the field, a mind full of bowling changes and fielding positions. Commentators and fans analysing your every move. Are you being too funky or not funky enough? Then, after all that, you have to go out and bat. As well as being held responsible for the collective success or failure of your team, you have your personal performance to take care of. The burden is heavy. Surely you're exhausted. Something must give, mustn't it?

It seems to be a fairly commonly held belief that the cost of doing what test teams usually do, in making one of their best batsmen the captain, will often come in the form of reduced run output from the player in question. In discussions of Joe Root, England's presumptive captain-in-waiting, I have certainly heard it raised that making him captain will dent his prolific run scoring.

It seems a reasonable enough worry to have. The captaincy certainly carries a lot of pressure with it, and a lot of extra responsibility which one would have thought would make it harder to focus on one's batting. But what does the evidence say? How does the captaincy affect a batsman's performance?

The graph below plots the batting average when playing as captain against the batting average when not playing as captain for all the test captains who have led their side at least 30 times.

Points below the blue line represent players who's batting average was lower when captaining, and points above the line represent players who were more prolific when skippering. There are two things to notice here:
1) Most points fall fairly close to the blue line- i.e. for most of the players in our sample their batting averages with or without the captaincy only differ a little bit.
2) There are more points above the line than below it (26 vs 17 to be precise)- i.e. it's more common for a player's average to improve with the captaincy than to decrease.

On average, the players in this sample increased their batting average by 3.76 runs when carrying the captaincy burden. I wouldn't read too much into that positive shift as it is much smaller than the sample standard deviation. The main take home message is that for most players the captaincy doesn't seem to make much difference to their average, and only for very few does their average significantly decrease.

I have heard it said that the England captaincy may carry peculiar pressures- perhaps due to the often slightly tempestuous relationship between players, media and fans in English sport. So one may wonder about the England captains of recent vintage in our sample. Of those only, Michael Vaughan (36.02 with captaincy vs 50.98 without) shows a big negative shift. Alastair Cook (49.94 vs 46.36), Andrew Strauss (40.76 vs 41.04) and Nasser Hussain (36.04 vs 38.10) all have pretty similar numbers for the two cases. Mike Atherton shows a slightly bigger shift but in the positive direction (40.58 vs 35.25).

So there's really not much compelling evidence to make us think that the captaincy depresses the run scoring of batsmen. But why, then, is this believed? I don't know, but my personal theory is this: when a player is given the captaincy they're usually coming off the back of a pretty good run- since you generally don't want to give the captaincy to a player unsure of their place. But all good runs must end eventually, for all players, captaincy or no. Whenever that does happen, this will be widely attributed to the pressures of captaincy catching up with them and the belief is perpetuated.

Test match captains are made of stern stuff- despite the pressure, they'll just carry on batting.

Tuesday, 10 November 2015

Pakistan's spinners have mastered the UAE where others have failed

For this post, I was reflecting on England's recent performance against Pakistan in the UAE. The consensus, after England's 2-0 defeat, seems to be that they performed fairly well but just came up against a side better suited to the conditions.

There's certainly a lot of truth in that. Despite the fact that Pakistan haven't been able to play tests in their home country in recent years their success in the UAE- where they've played in lieu of home matches- rivals some of the strongest home teams in test cricket. The graph below illustrates the 'home' record of each test match side since November 2010 (the period over which Pakistan have been laying regularly in the UAE). The 'x' axis shows the percentage of wins achieved by the 'home' side and the 'y' axis shows their net batting average - bowling average at home in that period.

By these measures Pakistan's record in the UAE is very close to England's in England- not bad considering they don't actually get to play at home.

The most obvious difference between the two sides was the performance of their respective spin bowlers. While England's batsmen floundered against the legspin of Yasir Shah; Adil Rashid, Moeen Ali and Samit Patel neither took regular wickets nor kept the runs down. I think it's fair to say that, in the main, they rightly haven't been over-harshly criticised, but I also think there's an air of disappointment surrounding the fact that the best spinners England could muster simply didn't seem to cut the mustard.

I would like to offer one point in mitigation of this- the UAE is actually quite a difficult place to be a non-Pakistani spinner. The graph below plots the bowling averages of 'home' and 'away' spin bowlers in each test match hosting nation since November 2010.




There's a (fairly weak) trend in the direction you'd expect- that in places where "home" spinners perform well, so do "away" spinners, at least relatively. But the performance of Pakistan's spinners in the UAE is far, far better than the overall performance of spinners for the touring sides they've been playing against. Pakistan's spinners average 29.65 in the UAE since November 2010, as compared with 44.69 for spinners from other test nations in the UAE. The difference between those two figures is the second highest for any of the test hosting nations. The largest difference between home and away spinners is in Australia, where baggy green spinners have been taking wickets at 41.63, as against 57.49 for touring sides.

So it seems that Pakistan's spinners have been finding a way to succeed in the UAE, where the best spin bowlers of touring sides have generally been struggling. Whether this is because of the pitches, because Pakistan's batsmen are really good at playing spin, something else, or a combination- I don't know. I do think that this to some extent sets the performance of England's spinners in some context- their collective average of 59.85, certainly remains a disappointment but there were always unlikely to be England's match winners in that series (although Rashid nearly was in the first test, but for the bad light). I also think it illustrates that there was never likely to be much tactical value in picking a third spinner for the third test, but perhaps a discussion of how to balance a bowling attack is one for another day.

Saturday, 31 October 2015

How long before a batting average means something?

Since I last posted, England have battled through two thirds of test series against Pakistan, acquitting themselves much better than at least I imagined they would, but still coming out behind. The struggles of England's middle order look set to lead to a test comeback for James Taylor.

In recent years, England's selectors have been praised for giving players a decent run in the side when called up- giving them more than or two chances to show what they can do. I assume, and hope, that the same treatment will be extended to Taylor and that, barring injury, he'll also play in the South Africa tour.

These ruminations lead me on to today's question: if we judge a batsman by their batting average, how many matches will it actually take before that average fairly reflects their ability?

I think most of us understand that quoting someone's batting average after two games isn't going to provide terribly strong evidence either way about how good they'll be in the long term. But how long should we wait before we can suppose that their average gives a strong clue as to their underlying run scoring prowess? In my experience, the conventional wisdom might place this number somewhere around 10 matches or a little more, depending on who you talk to.

To try and answer this question, I've attempted something a little different to my previous posts. Instead of using data from past test matches, I wrote a computer simulation to simulate the run scoring output of two (fictional) batsmen of known ability and looked at the distribution of their averages as a function of the number of innings played. The reason for doing this is that allows me to make a controlled 'experiment' in which I know how good the players in my simulation 'should' be and can see the degree to which statistical fluctuations obscure that in a finite sample of innings.

In my previous post, I argued that a player's vulnerability to getting out is only weakly dependent on how many runs they already have- being slightly elevated right at the very beginning of their innings (and maybe also a little elevated immediately after reaching 100).

I simulated the output of two players:

Player A had a 12% chance of getting out before reaching 5 and an 8% chance of getting out before scoring the next five runs thereafter. To put these numbers in context, this is very good- in the long run Player A could expect to average around 55.

Player B had a 16% chance of getting out before reaching 5 and an 12% of getting out before scoring the next five runs thereafter. This is rather more mediocre- in the long run Player B could expect to average around 35.

The two graphs below illustrate the probability distribution of batting averages for the each player as a function of the number of innings they were given in the simulation. The green points represent their median average after that number of innings and the red and blue points are the 10th and 90th percentile respectively. The region between the blue and red points reflects their likely range of batting averages after a given number of innings.

What's striking is that even after 50 innings the distributions are still quite broad - particularly for the better player (Player A). After 50 innings Player A has a 10% chance of averaging more than 66- making him look like a potential legend and also a 10% of averaging lower than 45 making look much more run of the mill.

Player B meanwhile has a 10% chance of averaging higher than 42 or lower than 28- the difference  between fairly good and pretty poor.

These averages are converging to a fair reflection of the players' abilities but they are doing so rather slowly- a hint that even after a fairly decent number of tests we need to base our judgements of players on more than their bare batting average.

Imagine if you were a selector, who brought these two imaginary players into your imaginary team and after a fixed number of tests had to choose between these two (perhaps you have a star player about to come back from injury and have to drop someone to fit him in). Would their averages be likely to guide you to the right decision?

The graph below shows the probability that the very good player A has a better average than the pretty mediocre player B after a given number of tests.


After 10 innings there's around an 80% chance that the averages will correctly reflect that player A is better than player B. Which sounds kind of okay, until one reflects that selection decisions are often- necessarily- based on fewer innings than that and that these two players are really not evenly matched at all- in the long run one would average a full 20 runs higher than the other.

Of course, in reality selectors have a lot more information available to them than just batting averages. Anyone can look up a players' average but selectors must exercise their judgement on a player's technique, temperament and suchlike using what they've seen in both matches and training. They have to do so because they don't have the luxury of letting a player play 20 test matches before making a decision about whether they're good enough- which is probably the minimum they would need to justify a decision based on batting average alone. To look at Gary Ballance's batting average of 47.76 after 27 innings, it's hard to avoid the conclusion he's been hard done by to not be in the team right now. And maybe he is- but one can't be sure of that from just his average.

It may well be the case that one could find a better way of estimating a batsman's ability from their stats after a small number of tests, which would converge on something fair a bit faster than simple batting average. On the other hand, fans like me should perhaps give selectors a break sometimes- they have rather complicated decisions to make, with rather limited and noisy information.

Sunday, 27 September 2015

When is a batsman 'in'?

After a bit of an unplanned break, I'm happy to return to looking at cricket's beliefs and the evidence behind them.

When a batsman reaches a reasonable score, somewhere around 20 or 30, we'll often find ourselves declaring that they've got themselves 'in'- that they've got used to the conditions and the nature of the bowling, they're seeing the ball well etc etc. The corollary of this is that right at the beginning of their innings we expect the batsman to be more vulnerable. This belief is reflected in staples of commentary like "one brings two" or the oft-repeated assertion that a batsman who gets out for 35 will be much more disappointed than one who gets out for 10 because they'd already "done the hard work".

For this post, I want to look at how a batsman's vulnerability to getting out changes as a function of how many runs they already have. This clearly impacts on what I just discussed above but also on another veteran of the cliché circuit: the idea of the "nervous nineties"- that a batsman's performance will change, and perhaps drop, as they approach the emotive figure of 100. I mention that one because it's the first piece of cricketing received wisdom that I remember having serious doubts about when I was a young, geeky, cricket lover. Anyway, enough of the origin story, on to the data.

The graph below plots the probability that a test match opening batsman will get out before scoring 5 more runs against how many runs they already have. I chose to look at opening batsman to start with because they all start their innings in circumstances which are to some extent comparable- i.e. against the new ball, with no runs on the board. The "error bars" are estimates of the uncertainty in the estimate of the probability with this sample size, based on the assumption that the count of batsmen getting out in a given interval obeys a Poisson distribution. (At this point I want to admit to not being a statistician by profession, I'm a physicist so I justified that assumption in my head by analogy with radioactive decay). The main point of the error bars is as a rough guide to how seriously you may want to take small wiggles in the data.


As you can see there is a quite a big drop in vulnerability going from 0 to 5 runs. After that the drop is much more gradual, so it seems that opening batsmen do most of their playing themselves in in the first 5 runs. After that their susceptibility to getting out only changes a very little, hovering around a
10% chance to get out before the next 5 runs from there on. Looking towards the right hand end of the line, there isn't much support for the idea batsmen are more vulnerable in the nineties. Indeed, if there's any increase in the likelihood of getting out around the 100 run mark it seems to be just after 100 not just before. Maybe celebrating the ton is a actually a serious distraction. We could call it the "hacky hundreds" or "hubristic hundreds". Or something.

The picture is similar for middle order batsmen (positions 3-5 in the order), as we see below.


There is a steep decline in vulnerability over the first five runs followed by something more gradual. Again, the rise in vulnerability around 100 seems to occur after 100, not before.

So it seems, averaging over all batsmen, over all test history that:
1) Batsmen seem to get 'in' quite quickly: most of the decline in vulnerability comes in the first five runs
2) Batsmen are more vulnerable immediately after scoring a hundred than immediately before.

Just to finish off, I thought it would be interesting to see how this looks for some individual players. Obviously, sample size is going to be a problem here, so this exercise can only make sense for players who've played a lot of tests. I chose to look at two current England veterans: Alastair Cook and Ian Bell, a legend they'll be facing soon: Younis Khan and recently retired Sri Lankan hero Kumar Sangakkara. To try to further mitigate the sample size thing I've looked at the data in blocks of 10 runs rather than blocks of 5, so the graphs below aren't directly comparable with the graphs above.

First, Cook and Bell:
The data's pretty noisy so it's hard to say too much. It is interesting to note though that while Bell really is a lot more vulnerable early on (binary Bell and all that), Cook's vulnerability shows very little systematic dependence on how long he's been in at all. But as you can see, the data's pretty messy.

On to the legends:

Again the data's noisy, but broadly consistent with what we saw above: an initial decrease in vulnerability followed by very little systematic dependence and more suggestion of a rise in vulnerability immediately after a 100 then before.

Go easy on the bat waving, centurions.

Friday, 28 August 2015

The value of the toss

Mike Selvey has written an interesting piece in the Guardian arguing that the toss makes very little difference to the outcome of test matches. This idea interests me, since pre-match analysis and the chat amongst fans often seems to imply enormous tactical significance to winning the toss. Could it be that it's all just pageantry?

Selvey backs up his point with statistics from England and Australia's recent history, but the subject intrigues me and I feel like there's room to chip in with my own two statistical penneth.

The table below shows the number of wins and losses for teams winning the toss in various formats. Taking my lead from the suggestion that uncovered pitches made a big difference to the value of the toss I've divided the Test data into pre- and post- 1970. (Honestly, I'm a bit young to remember uncovered pitches but this article suggests they began to be phased out in the 60s, which is why I picked 1970). I've split the data for limited overs formats into day, day-night and night since there's good reason to think that might be important.

I've also made an attempt at evaluating whether the difference between wins and losses is "statistically significant" in each case. More of that below.


The data is consistent with the uncovered pitches idea: the win/loss ratio for teams winning the toss is much better pre-1970 than post-1970. The post-1970 data, meanwhile, is pretty consistent with Selvey's assertion that the toss doesn't matter too much. The ODI data seems consistent with the idea that the toss doesn't matter much in Day games, but plays a role in Day-Night games. Counter-intuitively, the T20 data seems to reverse that trend.

So, what of this statistical significance?

One way of estimating whether a statistical finding is significant for a given sample size is to calculate the probability that you could have got a result at least equally extreme from that sample size, assuming that the "null hypothesis" is true. In our case "the null hypothesis" would be "the toss makes no difference". If this were true than in any given game (excluding draws) there would be a 50/50 chance that the toss would just happen to fall for the team that was going to win the game anyway, and from that assumption we can work out how likely it is that we would get a result as extreme as the one we did, from the sample size we have, if the toss really made no difference. This number is the "p-value" in the second-last column of the table.

Conventionally, if this number is less than 0.05 we call our result "statistically significant". There's a lot of issues with this approach to things, not least that the 0.05 threshold is completely arbitrary, but it at least gives us a rough starting point for deciding how much importance we should attach to a finding.

In this case, our results that the toss makes a (positive) difference in Day-Night ODIs, Daytime T20Is and that it used to make a difference (pre-1970) in Tests all pass our significance threshold of 0.05. The other cases fail to pass the threshold, which certainly isn't the same as saying we've proved the toss makes no difference in those cases, but does mean that we can't be sure it does with the data available.

As far as modern test matches go, it seems Mike Selvey is right- for the most part we probably do over-analyse the toss. Even if the difference it makes is real, it seems to be tiny. So, next time I think Alastair Cook's made the wrong post coin-flip decision, I'll try to remember to give the guy a break- it may well not make any difference.

Tuesday, 25 August 2015

Ian Bell's 'easy' runs

Today's post features something totally new for this blog: a reader's request. Specifically, Simon Mills asks:

"Can you test the hypothesis that Ian Bell only scored easy runs?"

Right now seems like a good time to reflect a bit on Ian Bell and his reputation as many are suggesting his international career could or should be about to draw to a close, after an Ashes series where he struggled to cut sufficient mustard. So, here goes.

Opposition

Clearly, how we answer the question of whether Ian Bell deserves to be labelled a scorer of 'easy runs' is going to depend on how we define 'easy'. One, very simple, way we could try to define it is to say
"easy runs are those scored against test cricket's weakest attacks"

The graph below plots Ian Bell's batting average against each test side against the overall batting average of middle order batsmen (positions 3-6 in the order) against each opponent over the period of Bell's career (Aug 2004-present). Points which fall above the red line represent nations against whom he has outperformed his peers and those below the red line represent the nations against whom he has fared worse than the 'average' middle order batsman of his era.



His batting average against each nation for the most part follows that of the average middle order batsman. Against Australia, South Africa, Pakistan, India and West Indies his average is within a few runs either way of the average performance for middle order batsmen against those opponents. There a couple of large exceptions in Sri Lanka (against whom he has over-performed compared to his peers) and New Zealand (against whom his record is poor). Then there's a giant honking outlier in Bangladesh, who he has really cashed in against averaging 158 compared to the 'average average' of 63.

Bangladesh aside, there isn't a very strong trend for Bell to strongly over-perform against weak attacks or under-perform against strong ones. His does score more runs against weaker bowling sides, but only to a degree comparable to the average middle order batsman of his time.

Match situation

Another way of looking at Simon's question is to define 'easy' and 'difficult' not by the opposition but by the match situation, saying something like:

'easy runs are scored when you come in with your team already in a good position'

To look at whether Ian Bell primarily scores runs when he comes in with England in a good position, I've compared his performance when coming in with less than 20 runs per wicket on the board (i.e. at scores worse than 20-1, 40-2 etc) against his performance coming in with more than 80 runs per wicket scored (scores better than 80-1, 160-2 etc). The results are in the table below. I've also broken it up into time periods pre- and post- his being dropped after the West Indies tour of 2009, an event many people consider a watershed in his career.


The result is that yes, he does score more runs coming in with a good platform laid, then coming in to a dicey situation. This is even more true of post-2009 Bell than pre-2009 Bell. Post-2009 Bell seems to be quite the master of putting the boot in from a well-laid platform. On the other hand, one shouldn't take it that he's useless when coming in in a tough situation- his average when coming in with fewer than 20 runs/wicket on the board is fairly close to his overall, pretty respectable, average.

Clearly, it's unfair to accuse Bell of being only a scorer of easy runs. The 2013 Ashes stand out amongst Bell's achievements but he's starred on many other occasions too. However, it is true to say he is more prolific at scoring against weaker attacks and in more comfortable match situations. That shouldn't surprise us too much- easy runs are, after all, easier.