Weighted On-base Average (wOBA) is one of the stats du jour currently thrown around by baseball fanatics and sabermatricians alike. The formula for wOBA isn’t difficult. According to Fangraphs, the wOBA formula for 2013 was:
If you’re running a version of the Lahman Database, this little equation is no problem since all the counting stats come from Lahman’s ‘Batting’ table.
The one massive catch is, the wOBA scale, i.e. the numbers multiplied by the counting stats, changes every year. This makes it difficult to compare wOBA over several different years without writing a massive SQL string.
Fortunately Fangraphs also provides this little beauty that lists the wOBA scales for every year from 1871 to present, which is luckily the same data range as the Lehman Database!
Download the csv file from Fangraphs and import it into your database schema as a separate table. Different databases have different methods for this but it’s normally quite simple.
Name your new table Guts (or whatever you want).
Presto! You can now compare wOBA values over several years with a single query. Assuming you named your new table “Guts” your SQL query should look something like this:
The below chart shows the wOBA leader since 2000 was Manny Ramirez, set during his monster season with the Cleveland Indians that year (the Fangraphs stats agree with this). It’s interesting to see that among the wOBA leaders from 2000 to 2013, the top of the list were all in the 2000 season. Interesting since the 2000 season was considered the “steroid era” and was before the MLB officially began testing for the drug in 2003.
To check, if you take out the yearID constraint from the WHERE clause, the all-time wOBA leader was Shoeless Joe Jackson in 1911 (hey Cleveland again!) and if you know your baseball you’ll know that Jackson’s 1911 season frequently tops the list for several batting stats.
comments powered by Disqus