Learning R through baseball: sab-R-metrics

January 21, 2011

(This article was first published on Revolutions, and kindly contributed to R-bloggers)

The words "statistics" and "baseball" are often found near each other, but there's a lot more to statistics than dividing the number of hits by the number of swings to get a batting average. And there's a lot more to sabermetrics — the statistical analysis of baseball — than averages, too. Many baseball fans are also stats geeks (and vice versa) and have done deep statistical analysis of baseball data, oftentimes with R

Dave Allen of the Baseball Analysts website regularly uses R to visualize PitchFX data, as does his stablemate Jeremy Greenhouse (for example, in this analysis of optimal swing rates). ESPN's the Sports Guy inspired a detailed analysis in R by Ryan Elmore. Ricky Zanker of the Hardball Times has published a guide on reading baseball data into R. Mike Driscoll created an interactive R application to visualize data from PitchFX. Even the widely-read New York Times election analyst Nate Silver got his statistical start with sabermetrics.

If you're a baseball fan and you'd like to do some sabermetrics of your own, but haven't made the leap to learn R yet, Millsy is here to help. He's a graduate student in Sport Management at the University of Michigan, and has created a series of tutorials to help you learn R by analyzing baseball data. The tutorials take the new R user and baseball fan step-by-step through your first R commands, reading in data, manipulating objects, and even creating charts and doing simple analysis. Good practical advice is scattered throughout, such as advice "to use color to help portray the information you are trying to communicate, rather than just to make things bright", with this awesome example of what not to do:


There are five parts to the series so far, and I'm looking forward to seeing more in this great series.

The Prince of Slides: sab-R-metrics

To leave a comment for the author, please follow the link and comment on their blog: Revolutions.

R-bloggers.com offers daily e-mail updates about R news and tutorials on topics such as: Data science, Big Data, R jobs, visualization (ggplot2, Boxplots, maps, animation), programming (RStudio, Sweave, LaTeX, SQL, Eclipse, git, hadoop, Web Scraping) statistics (regression, PCA, time series, trading) and more...

If you got this far, why not subscribe for updates from the site? Choose your flavor: e-mail, twitter, RSS, or facebook...

Tags: , ,

Comments are closed.


Mango solutions

RStudio homepage

Zero Inflated Models and Generalized Linear Mixed Models with R

Quantide: statistical consulting and training



CRC R books series

Contact us if you wish to help support R-bloggers, and place your banner here.

Never miss an update!
Subscribe to R-bloggers to receive
e-mails with the latest R posts.
(You will not see this message again.)

Click here to close (This popup will not appear again)