Preface..................................................................................................................................... 5
1. Cricket Analytics with cricketr....................................................................................... 6
1.1. Introducing cricketr! : An R package to analyze performances of cricketers......... 6
1.1.1. Introduction...................................................................................................... 6
1.1.2. The cricketr package........................................................................................ 7
1.1.3. Sachin Tendulkar’s performance – Basic Analyses........................................ 8
1.1.4. More analyses................................................................................................... 9
1.1.5. 3D scatter plot and prediction plane.............................................................. 10
1.1.6. Average runs at different venues................................................................... 11
1.1.7. Average runs against different opposing teams............................................. 12
1.1.8. Highest Runs Likelihood................................................................................ 13
1.1.9. A look at the Top 4 batsman – Tendulkar, Kallis, Ponting and Sangakkara. 14
1.1.10. Box Histogram Plot........................................................................................ 15
1.1.11. Contribution to won and lost matches........................................................... 18
1.1.12. Performance at home and overseas................................................................ 19
1.1.13. Relative Mean Strike Rate plot...................................................................... 20
1.1.14. Relative Runs Frequency plot........................................................................ 21
1.1.15. Moving Average of runs in career................................................................. 22
1.1.16. Future Runs forecast....................................................................................... 23
1.1.17. Check Batsman In-Form or Out-of-Form...................................................... 24
1.1.18. 3D plot of Runs vs Balls Faced and Minutes at Crease................................. 26
1.1.19. Predicting Runs given Balls Faced and Minutes at Crease........................... 27
1.1.20. Analysis of Top 3 wicket takers..................................................................... 28
1.1.21. Wicket Frequency Plot................................................................................... 28
1.1.22. Wickets Runs plot.......................................................................................... 29
1.1.23. Average wickets at different venues.............................................................. 30
1.1.24. Average wickets against different opposition............................................... 31
1.1.25. Relative Wickets Frequency Percentage........................................................ 32
1.1.26. Relative Economy Rate against wickets taken.............................................. 33
1.1.27. Wickets taken moving average...................................................................... 34
1.1.28. Future Wickets forecast................................................................................. 35
1.1.29. Contribution to matches won and lost........................................................... 36
1.1.30. Performance home and overseas.................................................................... 37
1.1.31. Check for bowler in-form/out-of-form.......................................................... 38
1.1.32. Key Findings................................................................................................... 39
1.1.33. Analysis of Top 4 batsman............................................................................. 40
1.1.34. Analysis of Top 3 legs spinners..................................................................... 40
Final thoughts................................................................................................................. 40
1.1.35. Batting............................................................................................................ 40
1.1.36. Bowling........................................................................................................... 41
1.2. Taking cricketr for a spin – Part 1......................................................................... 42
1.2.1. Introduction.................................................................................................... 42
1.2.2. Box Histogram Plot........................................................................................ 42
1.2.3. Relative Mean Strike Rate............................................................................. 46
1.2.4. Relative Runs Frequency Percentage............................................................. 47
1.2.5. Moving Average of runs over career............................................................. 48
1.2.6. Runs forecast.................................................................................................. 49
1.2.7. Check for batsman in-form/out-of-form........................................................ 50
1.2.8. 3D plot of Runs vs Balls Faced and Minutes at Crease................................. 51
1.2.9. Predicting Runs given Balls Faced and Minutes at Crease........................... 53
1.2.10. Contribution to matches won and lost........................................................... 54
1.2.11. Home and overseas performance................................................................... 55
1.2.12. Average runs at ground and against opposition............................................. 56
1.2.13. Key findings................................................................................................... 60
1.2.14. Final thoughts................................................................................................. 61
1.3. cricketr digs the Ashes!.......................................................................................... 62
1.3.1. Introduction.................................................................................................... 62
1.3.2. Analyses of Batsmen...................................................................................... 62
1.3.3. Box Histogram Plot........................................................................................ 62
1.3.4. Plot of 4s, 6s and the type of dismissals........................................................ 66
1.3.5. Relative Mean Strike Rate............................................................................. 70
1.3.6. Relative Runs Frequency Percentage............................................................. 71
1.3.7. Moving Average of runs over career............................................................. 72
1.3.8. Runs forecast.................................................................................................. 73
1.3.9. 3D plot of Runs vs Balls Faced and Minutes at Crease................................. 74
1.3.10. Predicting Runs given Balls Faced and Minutes at Crease........................... 76
1.3.11. Highest runs likelihood.................................................................................. 77
1.3.12. Average runs at ground and against opposition............................................. 80
1.3.13. Analysis of bowlers........................................................................................ 84
1.3.14. Wicket Frequency percentage........................................................................ 84
1.3.15. Wickets Runs plot.......................................................................................... 85
1.3.16. Average wickets in different grounds and opposition................................... 86
1.3.17. Relative bowling performance....................................................................... 90
1.3.18. Relative Economy Rate against wickets taken.............................................. 91
1.3.19. Moving average of wickets over career......................................................... 92
1.3.20. Wickets forecast............................................................................................. 93
1.3.21. Key findings................................................................................................... 94
1.4. cricketr plays the ODIs!......................................................................................... 95
1.4.1. Introduction.................................................................................................... 95
1.4.2. Plot of 4s, 6s and the scoring rate in ODIs..................................................... 96
1.4.3. Relative Mean Strike Rate........................................................................... 100
1.4.4. Relative Runs Frequency Percentage........................................................... 101
1.4.5. Percentage of 4s,6s in the runs scored......................................................... 102
1.4.6. Percent 4’s,6’s in total runs scored.............................................................. 102
1.4.7. Runs forecast................................................................................................ 103
1.4.8. 3D plot of Runs vs Balls Faced and Minutes at Crease............................... 104
1.4.9. Predicting Runs given Balls Faced and Minutes at Crease......................... 106
1.4.10. Highest runs likelihood................................................................................ 107
1.4.11. Average runs at ground and against opposition........................................... 110
1.4.12. Moving Average of runs over career........................................................... 114
1.4.13. Check batsmen in-form, out-of-form........................................................... 115
1.4.14. Analysis of bowlers...................................................................................... 116
1.4.15. Wicket Frequency percentage...................................................................... 116
1.4.16. Wickets Runs plot........................................................................................ 117
1.4.17. Average wickets in different grounds and opposition................................. 118
1.4.18. Relative bowling performance..................................................................... 122
1.4.19. Relative Economy Rate against wickets taken............................................ 123
1.4.20. Moving average of wickets over career....................................................... 124
1.4.21. Wickets forecast........................................................................................... 125
1.4.22. Check bowler in-form, out-of-form............................................................. 126
1.4.23. Key findings................................................................................................. 127
1.5. cricketr adapts to the Twenty20 International!.................................................... 129
1.5.1. Introduction.................................................................................................. 129
1.5.2. Analyses of Batsmen.................................................................................... 130
1.5.3. Plot of 4s, 6s and the scoring rate in ODIs................................................... 130
1.5.4. Relative Mean Strike Rate........................................................................... 134
1.5.5. Relative Runs Frequency Percentage........................................................... 135
1.5.6. Percent 4’s,6’s in total runs scored.............................................................. 136
1.5.7. 3D plot of Runs vs Balls Faced and Minutes at Crease............................... 137
1.5.8. Predicting Runs given Balls Faced and Minutes at Crease......................... 139
1.5.9. Highest runs likelihood................................................................................ 140
1.5.10. Moving Average of runs over career........................................................... 143
1.5.11. Analysis of bowlers...................................................................................... 144
1.5.12. Wicket Frequency percentage...................................................................... 144
1.5.13. Wickets Runs plot........................................................................................ 145
1.5.14. Relative bowling performance..................................................................... 148
1.5.15. Relative Economy Rate against wickets taken............................................ 149
1.5.16. Relative Wicket Rate.................................................................................... 150
1.5.17. Key findings................................................................................................. 152
1.5.18. Twenty 20 batsmen....................................................................................... 152
1.5.19. Twenty20 bowlers........................................................................................ 153
1.5.20. Key takeaways.............................................................................................. 153
1.6. Sixer – R package cricketr’s new Shiny avatar................................................... 154
1.6.1. Analyze batsman.......................................................................................... 154
1.6.2. Analyze bowler............................................................................................. 154
1.6.3. Relative performances of batsman............................................................... 155
1.6.4. Relative performances of bowlers............................................................... 155
1.6.5. Check for In-Form status of players............................................................ 155
1.6.6. Analyze batsman tab.................................................................................... 155
1.6.7. Analyze bowler tab....................................................................................... 157
1.6.8. Relative performance of batsmen (select more than 1)............................... 158
1.6.9. Relative performance of bowlers (select more than 1)............................... 159
1.6.10. Check in-form status of players................................................................... 161
2. Other cricket posts in R............................................................................................ 163
2.1. Analyzing cricket’s batting legends – Through the mirage with R..................... 163
2.2. Mirror, mirror … the best batsman of them all?................................................. 189
3. Appendix...................................................................................................................... 203
Cricket analysis with Machine Learning using Octave................................................. 203
3.1. Informed choices through Machine Learning – Analyzing Kohli, Tendulkar and Dravid........................................................................................................................ 204
3.2. Informed choices through Machine Learning-2 Pitting together Kumble, Kapil, Chandra.................................................................................................................. 215