{"id":177,"date":"2017-10-03T15:53:00","date_gmt":"2017-10-03T22:53:00","guid":{"rendered":"http:\/\/www.ootp.cavebutter.net\/blog\/?p=177"},"modified":"2017-10-03T15:53:00","modified_gmt":"2017-10-03T22:53:00","slug":"batting-stats-6-follow-up-on-woba","status":"publish","type":"post","link":"http:\/\/www.ootp.cavebutter.net\/blog\/archives\/177","title":{"rendered":"Batting Stats 6: Follow-up on wOBA"},"content":{"rendered":"<p>I wasn&#8217;t totally comfortable with the testing results for wOBA. \u00a0I didn&#8217;t change the calculation, but I did change my testing methodology. \u00a0The first time around was totally un-scientific: \u00a0I typed random player_id&#8217;s into a query, looked for stats that felt &#8216;good&#8217; (whatever that means), grabbed their names and searched for the stats in the game.<\/p>\n<p>I revisited my method several times. \u00a0Since my biggest misses in the last test were with small sample sizes and, since I don&#8217;t really care about stats with small sample sizes, I limited my sample to player-years with at least 200 AB&#8217;s. \u00a0Perhaps redundantly, I removed pitchers from the sample as well. \u00a0Thinking that there would be an easy way to grab the stats from OOTP, I limited the sample to the last two game years. (There&#8217;s not, really.) \u00a0Finally, rather than cherry picking records that passed some indefinable sniff-test, I assigned a random number to each record, sorted my results by that random number, and limited the result set to 30. \u00a0Then, I went into the game and looked up the stats for those player-years.<\/p>\n<p>Here&#8217;s the query that did that:<\/p>\n<pre class=\"line-numbers\"><code class=\"language-sql\">SELECT rand() as sorted\r\n  , p.player_id\r\n  , concat(first_name, \" \", last_name) as player\r\n  , b.year\r\n  , l.abbr \r\n  , b.ab\r\n  , b.woba\r\nFROM players p\r\n  INNER JOIN CalcBatting b ON p.player_id=b.player_id\r\n  INNER JOIN leagues l ON b.league_id=l.league_id\r\nWHERE p.position&lt;&gt;1 AND b.year&gt;=2014 AND b.ab&gt;200\r\nORDER BY sorted\r\nLIMIT 30;<\/code><\/pre>\n<p>I am much more comfortable with this result set:<\/p>\n<p><a href=\"https:\/\/i0.wp.com\/www.ootp.cavebutter.net\/blog\/wp-content\/uploads\/2017\/10\/woba-2.jpg\"><img data-recalc-dims=\"1\" loading=\"lazy\" decoding=\"async\" data-attachment-id=\"176\" data-permalink=\"http:\/\/www.ootp.cavebutter.net\/blog\/archives\/177\/woba-2\" data-orig-file=\"https:\/\/i0.wp.com\/www.ootp.cavebutter.net\/blog\/wp-content\/uploads\/2017\/10\/woba-2.jpg?fit=557%2C617\" data-orig-size=\"557,617\" data-comments-opened=\"1\" data-image-meta=\"{&quot;aperture&quot;:&quot;0&quot;,&quot;credit&quot;:&quot;&quot;,&quot;camera&quot;:&quot;&quot;,&quot;caption&quot;:&quot;&quot;,&quot;created_timestamp&quot;:&quot;0&quot;,&quot;copyright&quot;:&quot;&quot;,&quot;focal_length&quot;:&quot;0&quot;,&quot;iso&quot;:&quot;0&quot;,&quot;shutter_speed&quot;:&quot;0&quot;,&quot;title&quot;:&quot;&quot;,&quot;orientation&quot;:&quot;0&quot;}\" data-image-title=\"woba 2\" data-image-description=\"\" data-image-caption=\"\" data-large-file=\"https:\/\/i0.wp.com\/www.ootp.cavebutter.net\/blog\/wp-content\/uploads\/2017\/10\/woba-2.jpg?fit=557%2C617\" class=\"aligncenter size-full wp-image-176\" src=\"https:\/\/i0.wp.com\/www.ootp.cavebutter.net\/blog\/wp-content\/uploads\/2017\/10\/woba-2.jpg?resize=557%2C617\" alt=\"\" width=\"557\" height=\"617\" srcset=\"https:\/\/i0.wp.com\/www.ootp.cavebutter.net\/blog\/wp-content\/uploads\/2017\/10\/woba-2.jpg?w=557 557w, https:\/\/i0.wp.com\/www.ootp.cavebutter.net\/blog\/wp-content\/uploads\/2017\/10\/woba-2.jpg?resize=271%2C300 271w\" sizes=\"auto, (max-width: 557px) 100vw, 557px\" \/><\/a>77% were within range and 3 of the 5 that were medium were within 3 points of being good. \u00a0The two bad ones were really bad, though. \u00a0I will take a look at those particular seasons to see if I can find any stats that are out of normal range. \u00a0My thought is that somehow I am weighting a less-common stat (such as hit by pitch) incorrectly. \u00a0For a normal season, if HBP is weighted wrong but only occurs 5 times in 600 plate appearances, no big deal. \u00a0But if a guy got plunked 50 times or something, it could really throw off the calculation. \u00a0That&#8217;s my working theory going in at least. \u00a0If I find something weird, I will report back. \u00a0Otherwise, I&#8217;m going to move on.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>I wasn&#8217;t totally comfortable with the testing results for wOBA. \u00a0I didn&#8217;t change the calculation, but I did change my testing methodology. \u00a0The first time around was totally un-scientific: \u00a0I typed random player_id&#8217;s into a query, looked for stats that felt &#8216;good&#8217; (whatever that means), grabbed their names and searched for the stats in the&hellip; <a class=\"more-link\" href=\"http:\/\/www.ootp.cavebutter.net\/blog\/archives\/177\">Continue reading <span class=\"screen-reader-text\">Batting Stats 6: Follow-up on wOBA<\/span> <span class=\"meta-nav\" aria-hidden=\"true\">&rarr;<\/span><\/a><\/p>\n","protected":false},"author":2,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"_jetpack_newsletter_access":"","_jetpack_dont_email_post_to_subs":false,"_jetpack_newsletter_tier_id":0,"_jetpack_memberships_contains_paywalled_content":false,"_jetpack_memberships_contains_paid_content":false,"footnotes":"","jetpack_publicize_message":"","jetpack_publicize_feature_enabled":true,"jetpack_social_post_already_shared":true,"jetpack_social_options":{"image_generator_settings":{"template":"highway","default_image_id":0,"font":"","enabled":false},"version":2},"jetpack_post_was_ever_published":false},"categories":[25],"tags":[],"class_list":["post-177","post","type-post","status-publish","format-standard","hentry","category-batting"],"aioseo_notices":[],"jetpack_publicize_connections":[],"jetpack_featured_media_url":"","jetpack_sharing_enabled":true,"jetpack_shortlink":"https:\/\/wp.me\/p9cxb5-2R","jetpack_likes_enabled":true,"jetpack-related-posts":[],"_links":{"self":[{"href":"http:\/\/www.ootp.cavebutter.net\/blog\/wp-json\/wp\/v2\/posts\/177","targetHints":{"allow":["GET"]}}],"collection":[{"href":"http:\/\/www.ootp.cavebutter.net\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"http:\/\/www.ootp.cavebutter.net\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"http:\/\/www.ootp.cavebutter.net\/blog\/wp-json\/wp\/v2\/users\/2"}],"replies":[{"embeddable":true,"href":"http:\/\/www.ootp.cavebutter.net\/blog\/wp-json\/wp\/v2\/comments?post=177"}],"version-history":[{"count":2,"href":"http:\/\/www.ootp.cavebutter.net\/blog\/wp-json\/wp\/v2\/posts\/177\/revisions"}],"predecessor-version":[{"id":179,"href":"http:\/\/www.ootp.cavebutter.net\/blog\/wp-json\/wp\/v2\/posts\/177\/revisions\/179"}],"wp:attachment":[{"href":"http:\/\/www.ootp.cavebutter.net\/blog\/wp-json\/wp\/v2\/media?parent=177"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"http:\/\/www.ootp.cavebutter.net\/blog\/wp-json\/wp\/v2\/categories?post=177"},{"taxonomy":"post_tag","embeddable":true,"href":"http:\/\/www.ootp.cavebutter.net\/blog\/wp-json\/wp\/v2\/tags?post=177"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}