Data Viz Done Right

May 16, 2012

Is drug testing working in baseball? An interactive analysis.


Cork Gaines wrote about the HR trend in baseball since testing started for performance enhancing drugs.  He presented a chart of the trend (surprising effective given his past charts), but he never answered his own question….is testing working? 

One way to determine the answer is through comparisons to other statistics.

I downloaded the season averages across both leagues and MLB in total from baseball-reference and built this interactive analysis.  The stats are order by batting stats then pitching stats.

This viz allows you to compare home runs to many other statistics through the selectors at the top right.  In addition you can:

  1. View any two statistics to look for trends by choosing a primary measure and a comparison
  2. Filter the time frame to all years, the pre-testing era, and the testing era (1993+)
  3. Filter the leagues to focus your analysis
  4. Click on a league at the bottom to highlight that league

In this initial view of HR vs. ERA, I see a couple of things:

  1. HR are on a slow descent in the testing era, especially since 2000
  2. ERA is in a similar decline, possibly indicating that improved pitches has had as much of an impact as testing
  3. Batting Average has remained flat.  This means that the reduction in HR has not impacted BA.
  4. Teams are simply scoring fewer runs, likely due to the reduction in long balls
  5. The trend in complete games is despicable

What do you see?  Play around with the different stats and see if you can draw any conclusions.


  1. Unfortunately, there's too many factors here to easily say that drug testing is linked to depressed power.

    Perhaps the offensive talent pool is shallower than it was 10 or 15 years ago. Perhaps the pitching talent pool is better. Who's to say?

    About the only thing we really can do is view the specific stats that are isolated measures of pure performance. Said another way; focus on the things that pitchers or hitters can directly influence.

    A perfect example, would be pitchers' walk rates, or strikeout rates. These are individual outcomes that are within the pitcher's sphere of influence.

    When looking at a SO/9 or BB/9 we see a stark trend in the favor of the pitcher (fewer walks; more strikeouts). To my knowledge, taking steroids or other PEDs would have no bearing on these stats because the ball was never put in play.

    This leads me to believe that any dip in HR (or triples/doubles for that matter) are less about PED usage and more about the increased control and strikeout ability of pitchers.

  2. Matt,

    I agree with your assessment. One of the problems I had with the original chart/blog is that there was an inference that testing has led to a decline in HRs. If I were to make an inference from the data, I would be in agreement with you; pitching has improved. Better pitching = less home runs.

    Thanks for reading!