Table of Contents

Thursday, June 05, 2014

Selling Jeans: Ballplayer Height, Weight, and BMI

So, my question for today is: how have the physical attributes of ballplayers changed over the years?  Let's look at this graphically.

Player Height

I'm reporting all dates as birth year, as that seemed a logical way of organization players.  I'm also throwing out the edges of the database that contain fewer than 50 players per birth year.  That means, for recent years, I'm not including anyone born after 1990 (i.e. 24 years old in 2014).

We can see that, after an initial surge of the extremely short in late-1880's ball as baseball became more professional and required players to be top athletes, average player height quickly reached 70 inches (5'10", aka jinaz-standard height) and then progressively have gotten taller, on average, as a group.  Currently, baseball players average just shy of 74" (6'2").

No real surprises here.  Thanks to some combination of improved diet, sanitation, medicine, and social programs, average human height has increased four inches in the past 100 years, and ballplayers are right on track with that increase:
Furthermore, major league baseball players tend to be taller than the average population.  Current average height is 5'10", while ballplayers today average 6'2".  Among those born in the 1920's, average height was around 170 cm on this graph (67", or 5'7"), while baseball players.averaged 5'10".

Weight

This one's a bit more interesting:
So, we have a steady increase to 1920, then a slight increase that follows height...and then BOOM, something happens.  Weight shoots from 188 lbs to 206 lbs in a matter of 13 years (1965-1979 birth years).  That corresponds to players who played their age-27 years between 1992 and 2006.  What gives?

Before we address that question, let's first look at one more graph


Body Mass Index


So here, we're seeing a metric that tracks both height and weight in the same number.  And again, we're seeing a steady drop in BMI as the game becomes professional, a flat-lined BMI for many decades, and then a spike again once we hit 1965 babies.

The knee-jerk reaction is to claim that this matches up pretty well with the PED era.  There are no clear fenceposts for when that era began and ended, but I tend to think of the steroid era running from around 1994 (the year of The Strike) until the advent of MLB's testing program in 2003.  The steep part of the slope begins and ends, more or less, with players who peaked during that period of time (1992 through 2006).

The interesting thing is that it hasn't really dropped that much since MLB started its testing program.  Average weight of players has decreased slightly since its peak in 1982 babies (208.7 lbs) through 1989 babies (205 lbs).  Height has also dropped slightly during that time (0.3 inches), so BMI changes very little in that time.  That span describes players who are currently ages 25-33.  These are players that, by and large, have played their careers during a setting in which drug testing was a thing.  And yet, while they've declined, we're a far cry from where we might expect to be before that spike.  If the spike in weight and BMI occurred due to steroids taking over the game, and if the current testing program works well enough that steroids are now largely NOT a part of the game, we'd predict weight and BMI to return to pre-steroid levels.

My feeling is that some of this could be steroids.  But I think there's two other, important factors that could be involved:
  1. A shift in training regimes of players: an emphasis on being bigger, stronger, and faster through weight lifting and nutrition...and for scouts to prefer bigger players.
  2. An influx of international talent (including lots of big guys) that push up the pool of available talent.  If you have more players available to choose from, and baseball favors larger humans, you'll be able to shift up the averages by casting a larger net when selecting players.
The latter one seems like it could be a big deal, and I can think of a few ways to test it.  But I'll need to sharpen up my database skills a bit better to do so. :)

Thoughts?

What ex-Ballplayer Was Born at Sea?

So, I was playing around with some basic queries in the Lahman Database for the SABR101x course.  I decided to do a search on the birthCountry column.  Here's something that caught my eye:

Who is that?  Well:
Ed Porray pitched 10 innings for the Buffalo Buffeds in 1914.  The Buffeds were part of the Federal League.  He finished the season, and his big league career, with a 4.35 ERA and a 6.99 FIP.  And, he's a now the answer to a trivia question!

Wednesday, June 04, 2014

The First Week of SABR101x

We're at the end of the first week of +Andy Andres' SABR101x course, offered through +edX.  Having completed the materials, I thought I'd share a few reflections.

The EdX Platform & Distance Education

The discussion forums are an important part of what
makes courses on edX work.
This is my first edX course, but I don't think it will be my last.  I'm pretty impressed with it as a platform.  It strikes me as an excellent learning platform, with the ability to deliver a tightly organized course that presents information in multiple ways.  Furthermore, it allows students to interact with assessments via multiple choice-style questions as well as text entry, and to interact with each other via targeted discussion boards that can be inserted into specific stopping points within lectures.  

I'm a college professor in my day job.  I teach brick-and-mortar classes, and have avoided digging into the realm of online classes.  One of the things that I'll be doing is taking a look at how the course is constructed, both in terms of information progression as well as the mechanics of how Andres presents the material.  There's a lot to like, here.  The lectures are presented in short video format that usually runs 5-13 minutes in length.  In between, there are at least a few quick assessment questions, which gives students a chance to think about and process what they've just learned.  And intermixed with the lectures are short, 1-2 page written explanations that complement, but are not redundant with, the lecture material.

One thing that I didn't anticipate was how much I like having the narration to go along with the video/audio.  As a learner, I know that I do best when I can both see and hear something.  But, aside from video games, it's rare that I've had the chance to watch and listen to a narrative at the same time.  I can tell that I can grasp concepts much better when getting to read and see at the same time.  I don't plan to turn on the substitles on my home TV any time soon, but it's great for an education setting.  Along the way, I'm keeping a google doc window open where I can take notes as well.

As a side note, reading the narration allows for fun little quirks.  I feel bad for whoever they had transcribing all of the words, as that doesn't seem like a fun job.  But watching them try to spell Voros McCracken's name was funny ("Vhoorees," I think?).


SABR101x Content, Week 1

This week began with a basic introduction to sabermetrics.  Andres started exactly where I tend to start most of my courses: by defining terms.  He spent a lot of time looking at dictionary definitions, as well as definitions from those in the disciplines covered here: sabermetrics, statistics, data science, and big data.  These kinds of discussions always seem a little bit laborious.  But at the same time, they provide the opportunity to dispel a lot of misconceptions.  They also help enforce the idea what we need to be precise with our language.  I found the definitions when discussing databases to be particularly helpful, because I have very little background in that area.

Beyond definitions, this week was pretty light in content.  We took our first stab at running some MySQL queries in the BUx SQL Sandbox that Andres and his team set up on edX, and it worked well enough.  They set up a Lahman database and got everything set so that users needed only to type in the queries as presented in order to retrieve their data.  There is no inherent need to set up one's own SQL server/workbench to complete the course (although I did just that; see below).

Assessment thus far has been pretty light.  Some of the questions have been recall of minutia.  For example, one of the first questions asks you to report the year in which Bill James coined the term sabermetrics.  Good grief. :)  But most answers have been readily apparent from the videos, if one is paying attention & taking at least light notes.  Coding submissions are graded based on the output MySQL server stemming from your query, as far as I can tell.  So far, the coding assignments have basically been copy-and-paste exercises that require almost nothing from the student.  Still, a glance at the discussions shows that students are still having trouble with this.  Therefore, basic practice in syntax and input is probably appropriate at this stage of the course.  Future modules will almost certainly require a bit more thought in the assessment sections.

There is also a History of Sabermetrics track in the course.  This week's focus was on Henry Chadwick. Chadwick is sometimes known as the Father of Baseball, and is sometimes mentioned as an early pioneer of baseball in the same breath as Abner Doubleday (who, for a moment, was confused in my mind with Albus Dumbledore!  Go figure!).  But, as Andres notes, he was also the first real sabermetrician.  While he might not have actually invented box scores, he established a careful approach to observing, recording event, and the reporting on games that was pioneering.  He also was instrumental in carefully recording and refining the rules of the game.  Furthermore, through his writing in newspapers and his books on baseball, he was instrumental in publicizing and popularizing reports of baseball.  He's a guy that I've read a bit about before, most notably in Alan Swartz's Number's Game (which I read close to a decade ago!  'Tis a bit fuzzy).  Nevertheless, I found it a neat little foray into baseball history to learn more about him.  I'm looking forward to more of these history segments.

My Own MySQL Workbench

A local copy of MySQL Workbench offers a lot of
usability advantages over running from the course sandbox.
In order to get more practice, and to be set up to work on my own, I did opt to get a MySQL server running on my own computer.  I went to MySQL's website and downloaded their installer for "MySQL on Windows."  It was pretty easy to set up, although there was one hiccup where a certain "ODBC Connector" file (whatever that is) was not found by the installer and I had to download and install it manually.  Once installed, I launched the program and s elected Database-->Connect to Database from the menu.  That launched the workbench, which gave options to "Startup/Shutdown" the server.  Once started, my next step was to install the Lahman database (Andres provided a specific one to users of the site--they apparently made some changes?  There were two files...I went ahead and installed both as a SABR_101x schema in MySQL, seems ok!).

Now, I'm set to run queries!  Everything that works in the course works on my rig, although mine was installed such that all table names are lowercase.  There's an option in the server settings to not do that, but things were getting screwy when I changed that.  So...I'm just going to remember that this is a difference between the course and my computer.  I actually prefer this, because tables are not case sensitive on my system.  But I'm sure I'll get a few submissions wrong in the course as a result!

The interface of this workbench is light-years nicer than what I used when following Colin Wyers' instructions some years ago to install the Essentials SQL server/workbench.  There are options to save queries as script files, which is huge.  As you're editing, the editor color-codes commands, and offers pop-up help whenever you put your cursor on specific functions or operators.  I also love the schema view: you can select multiple columns in a table--or even multiple tables--with your mouse, right click, and it will automatically add the appropriate bare-bones SELECT text.  It's very nice.



That's all I have for now.  If you're on the edX course, I'm going by Justin90 there.  Please feel free to say "hi" if you see me on the forums.  Or, of course, just chime in here!

Big Data Coming to Baseball


Baseball sabermetrics has really always been about fairly large datasets.  A single batter's hitting line often reaches 700 plate appearances in the course of a season.  There are over 1000 players who have donned a cap in major league baseball this year, with thousands more in the minor leagues.

One of this week's topics in +Andy Andres ' Sabermetrics 101x course this week is Big Data, with the capital B and D.  There are a number of good points made in his introduction, but one of the most important is that big data does not always mean better data.  Big data can be fraught with bias (lack of controls, systematic bias in data collection), a problem that Colin Wyers has long railed against with our favorite defensive metrics.  Big data can also lead to false conclusions because statistical approaches no longer work well.  When your sample size gets into the thousands, P-values below 0.05 get easy to reach, even when there is no actual meaning to the difference found.

This spring, MLBAM announced a new stream of data with its new player tracking system.  This system, which is already in operation in a few parks this year, will track virtually everything on the baseball field: player position, ball trajectories from the pitchers' hand and from the bat into the field.  It is essentially a replacement of the pitchf/x, hitf/x, and fieldf/x system we've been using (or, in the latter two cases, at least hearing about).  

It's incredibly exciting to hear that this will be used.  The question will be how much of these data will be available to the fan community at large.  We probably don't need to be able to download all 7 TB of data.  But hopefully, we'll get something.  My wish list:
  • Everything we currently have with the pitchf/x system for tracking pitches.
  • The equivalent of pitchf/x, but for batted balls.  Therefore, we'd get vertical trajectory, vector the ball was hit, velocity, spin, and landing location/hang time.  
  • For fielding, ball landing location alone would be a great step forward.  It could be fed directly into our UZR-like algorithms, and immediately improve them by removing systematic bias in our hit location data.  Initial player position could also be really useful, if nothing else than to help distinguish shifts when they happen.
Some of the other measures they show in the videos, like acceleration, reaction time, and maximum speed, could be interesting, and it would be great if they were released along with the stuff above.  But I'm also not sure, for the time being, that I'll be all that interested in them.  With what is described above, we'd have a wealth of useful analytical information at our hands.  From the perspective of valuing players, which is often my main interest, it really doesn't matter if a player gets from point A to point B because they get a great jump, because they have great route efficiency, or because they're fast.  What matters is that they get there.  

Of course, if I'm a team, I care a lot more about the minutia.  It might be that maximum speed can't be taught.  But reaction speed might be able to be taught, and route efficiency almost certainly can be (right?).  But personally, I'm most interested in just evaluating player value.

The concern, of course, is how much of the data will actually be available to us.  I'm frankly a bit scared about this.  Potentially, MLBAM could be really stingy with these data, and we might end up with LESS information than we have now through pitchf/x.  I'm hopeful that this won't happen, however, and I've no doubt that folks like +David Appelman at +FanGraphs will be doing his best to have access to, or perhaps even license, some of the critical info that we as a community want.  

Once the data ARE available, the question will be how well the community makes use of them.  I have no doubt that we'll see a lot of spurious conclusions in the early goings.  Fortunately, the sabermetric community is pretty good at policing itself, and correcting its past mistakes.  We have a lot of bright minds in this community, and hopefully, within a few years, we'll have a good grasp of what these data can and cannot do.

Postscript

I embedded one of the videos that MLBAM released above.  What follows (below the break) are the some of the other interesting ones.  It's really exciting stuff!

Tuesday, June 03, 2014

Giants Series Preview

Pablo Sandoval: Striking out at career norms!
Photo Credit: S.D. Dirk
Here's the series preview that I wrote for the Giants/Reds series this week.  It included an update to my piece on strikeout rate risers from last month:
I'm pretty sure that, based on his preseason weight reports, this was supposed to be a good Pablo Sandoval year.  He had a really tough first month, and I noted that on May 8th, his strikeout rate had risen as high as 22% while wOBAing 0.240.  He's made a nice turn-around since then, however, and is regressing quickly back up to his career norms.  So, maybe a good year isn't out of the question after all!
The lesson here is that even when you're looking at appropriate sample size (based on Pizza Cutter's study) for a given statistic, there's still plenty of reason to expect players will project more toward their career averages than their most recent rates.  In Sandoval's case, he posted a 20.6% strikeout rate in April, but followed up with a 13% strikeout rate in May.  His career strikeout rate?  13%.

Monday, June 02, 2014

Stephen Drew Signs; Draft Pick Penalty is Terrible, Should Go

Stephen Drew finally found a home, right back
where he started.  Photo credit: Keith Allison
I'd missed the initial news, but Stephen Drew apparently has finally found a job.  After the draft pick penalty prevented him from finding gainful employment with a number of teams who otherwise could have used his services, he ended up signing again with the Boston Red Sox.  Because they are re-signing their player, the Red Sox do not give up a compensation pick to sign Drew, but they also don't get a pick that would have otherwise come to them from Drew's signing team (although the chances of that were almost zilch at this point).

As I wrote in March, this system is terrible.  I like the idea of giving an extra draft pick to the team who loses a quality player via free agency.  Furthermore, I *really* like the qualifying offer system as a way to let the market dictate the value of a player, as opposed to using Elias's horrific player rating system.  But I see no reason why the team that signs a player should be penalized, as this ultimately results in a penalty to the player.  Stephen Drew might not be an elite player, but baseball is better with him in the game.  I'd love to see the lost-pick penalty go immediately.

Everything I've heard about it, however, indicates that nothing will change until the current CBA expires after 2016.  That means that we're in for another two offseasons of this nonsense.  Stephen Drew and the other players in his situation were effectively denied their free agency.  It's not collusion, because teams are acting in their individual best interests.  But the effect seems very much the same.

Sunday, June 01, 2014

Cueto getting early Cy Young respect

Johnny Cueto has had an amazing first third of a season.  To wit:

I mean, sheesh.  His velocity continues to be the highest it's been in the past three years, he control has been pinpoint, and he's striking guys out at easily the highest rate of his career.

David Pinto has produced a Cy Young tracker script that employs both Bill James' and Tom Tango's Cy Young point systems.  These systems are designed to predict Cy Young winners, not establish who is the best player.  Despite only having a 5-4 record, which matters for these point systems, Cueto has a sizable lead using Tom Tango's Cy Young points.

At least one mainstream outlet (albeit not necessarily a prototypical "mainstream writer" in Dayn Perry) has noticed, and tapped Cueto as the first third Cy Young winner:
This award belonged to Adam Wainwright before his Friday night stinker against the Giants. Now it falls to Cueto, who, that previous qualifier notwithstanding, is quite worthy. Presently, he leads the NL in innings and the majors in strikeouts. More to the point, Cueto boasts an ERA of 1.83, and opposing hitters are batting just .148/.207/.251 against him. He's also logged 10 quality starts in 11 trips to the mound.
I'm still not sure if we'll see Cueto in a Reds uniform by the season's end.  The Reds would have to go on one heck of a tear to get back in the division race, and Cueto, while not expensive for his production, should almost unquestionably bring more trade value now than he ever will.  But it has been awfully fun to watch him have this kind of season.