{"id":4755,"date":"2014-09-02T16:58:43","date_gmt":"2014-09-02T20:58:43","guid":{"rendered":"http:\/\/www.decisionsciencenews.com\/?p=4755"},"modified":"2014-09-05T12:04:42","modified_gmt":"2014-09-05T16:04:42","slug":"baseball-probability-winning-conditional-runs-hits-walks-errors","status":"publish","type":"post","link":"https:\/\/www.decisionsciencenews.com\/?p=4755","title":{"rendered":"Baseball: Probability of winning conditional on runs, hits, walks and errors"},"content":{"rendered":"<p>SIMPLY COUNTING OVER 44 YEARS OF DATA<\/p>\n<p><meta property=\"og:image\" content=\"http:\/\/www.decisionsciencenews.com\/wp-content\/uploads\/2014\/09\/srel_runs.png\" \/><\/p>\n<p style=\"text-align: center;\"><a href=\"http:\/\/www.decisionsciencenews.com\/wp-content\/uploads\/2014\/09\/srel_runs.png\"><img loading=\"lazy\" decoding=\"async\" class=\"size-full wp-image-4758 aligncenter\" src=\"http:\/\/www.decisionsciencenews.com\/wp-content\/uploads\/2014\/09\/srel_runs.png\" alt=\"srel_runs\" width=\"485\" height=\"485\" \/><\/a><\/p>\n<p>We have a father-in-law who likes baseball. Occasionally, he asks us to figure out things, which we are more than happy to do. The last request was to figure out:<\/p>\n<p><em>If a team scores X runs, what&#8217;s the probability it will win the game?<\/em><\/p>\n<p>Luckily, we had the data to solve this problem (<a href=\"http:\/\/www.decisionsciencenews.com\/2010\/05\/05\/you-won-but-how-much-was-luck-and-how-much-was-skill\/\">as mentioned in past posts<\/a>). Looking back over 44 years of baseball games, we looked at how often a home team scored 1 run, and counted how often the home team won. We then looked at 2, 3, 4 runs, up to 11 runs. We stop at 11 runs because we only wanted to compute relative frequencies when there&#8217;s a decent amount of data. In all our analyses here, we cut the x-axis when there are fewer than 500 observations per bin. We analyzed the visiting team&#8217;s scores separately, to see the effect of the home team advantage.<\/p>\n<p>The result is shown above. If you consistently score 3-4 runs a game, you&#8217;re winning about half the games. It&#8217;s simply not good enough. Going from 2 runs a game to 6 runs a game means going from winning 25% of the time to winning 75% of the time&#8211;all the difference in the world.<\/p>\n<p>Because we had the data handy, we couldn&#8217;t help but looking at the same thing for the other key statistics: hits, walks, and errors. Results below.<\/p>\n<p style=\"text-align: center;\"><a href=\"http:\/\/www.decisionsciencenews.com\/wp-content\/uploads\/2014\/09\/srel_hits.png\"><img loading=\"lazy\" decoding=\"async\" class=\"aligncenter size-full wp-image-4757\" src=\"http:\/\/www.decisionsciencenews.com\/wp-content\/uploads\/2014\/09\/srel_hits.png\" alt=\"srel_hits\" width=\"485\" height=\"485\" \/><\/a><\/p>\n<p style=\"text-align: center;\"><a href=\"http:\/\/www.decisionsciencenews.com\/wp-content\/uploads\/2014\/09\/srel_walks.png\"><img loading=\"lazy\" decoding=\"async\" class=\"aligncenter size-full wp-image-4759\" src=\"http:\/\/www.decisionsciencenews.com\/wp-content\/uploads\/2014\/09\/srel_walks.png\" alt=\"srel_walks\" width=\"485\" height=\"485\" \/><\/a><\/p>\n<p style=\"text-align: center;\"><a href=\"http:\/\/www.decisionsciencenews.com\/wp-content\/uploads\/2014\/09\/srel_errors.png\"><img loading=\"lazy\" decoding=\"async\" class=\"aligncenter size-full wp-image-4756\" src=\"http:\/\/www.decisionsciencenews.com\/wp-content\/uploads\/2014\/09\/srel_errors.png\" alt=\"srel_errors\" width=\"485\" height=\"485\" \/><\/a><\/p>\n<p>Want to play with it yourself? The <a href=\"http:\/\/www.r-project.org\/\">R<\/a> \/ <a href=\"http:\/\/had.co.nz\/ggplot2\/\">ggplot2<\/a> code that made this plot is below. ggplot and dplyr are <a href=\"http:\/\/twitter.com\/#!\/hadleywickham\">Hadley Wickham<\/a> creations.<\/p>\n<p><script src=\"https:\/\/gist.github.com\/anonymous\/eb7a79d5b1d01a73dc47.js\"><\/script><br \/>\n<code><br \/>\n<\/code><\/p>\n","protected":false},"excerpt":{"rendered":"<p>If a team scores X runs, what&#8217;s the probability it will win the game?<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"jetpack_post_was_ever_published":false,"_jetpack_newsletter_access":"","_jetpack_dont_email_post_to_subs":false,"_jetpack_newsletter_tier_id":0,"footnotes":"","jetpack_publicize_message":"","jetpack_publicize_feature_enabled":true,"jetpack_social_post_already_shared":true,"jetpack_social_options":{"image_generator_settings":{"template":"highway","enabled":false}}},"categories":[16,74],"tags":[791,81,52,941,169,500,938,60,1208,939,59,70,940,937,942],"class_list":["post-4755","post","type-post","status-publish","format-standard","hentry","category-ideas","category-r","tag-analysis","tag-baseball","tag-decision","tag-errors","tag-ggplot","tag-hadley","tag-hits","tag-news","tag-r","tag-runs","tag-science","tag-statistics","tag-walks","tag-wickham","tag-winning"],"jetpack_publicize_connections":[],"jetpack_featured_media_url":"","jetpack_shortlink":"https:\/\/wp.me\/p4LKj-1eH","jetpack_sharing_enabled":true,"_links":{"self":[{"href":"https:\/\/www.decisionsciencenews.com\/index.php?rest_route=\/wp\/v2\/posts\/4755","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.decisionsciencenews.com\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.decisionsciencenews.com\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.decisionsciencenews.com\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/www.decisionsciencenews.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=4755"}],"version-history":[{"count":9,"href":"https:\/\/www.decisionsciencenews.com\/index.php?rest_route=\/wp\/v2\/posts\/4755\/revisions"}],"predecessor-version":[{"id":4773,"href":"https:\/\/www.decisionsciencenews.com\/index.php?rest_route=\/wp\/v2\/posts\/4755\/revisions\/4773"}],"wp:attachment":[{"href":"https:\/\/www.decisionsciencenews.com\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=4755"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.decisionsciencenews.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=4755"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.decisionsciencenews.com\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=4755"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}