batting {UsingR} | R Documentation |
This dataset contains batting statistics for the 2002 baseball season. The data allows you to compute batting averages, on base percentages, and other statistics of interest to baseball fans. The data only contains players with more than 100 atbats for a team in the year. The data is excerpted with permission from the Lahman baseball database at http://www.baseball1.com/.
data(batting)
A data frame with 438 observations on the following 22 variables.
AL
NL
Baseball fans are “statistics” crazy. They love to talk about things like RBIs, BAs and OBPs. In order to do so, they need the numbers. This data comes from the Lahman baseball database at http://www.baseball1.com/. The complete dataset includes data for all of baseball not just the year 2002 presented here.
Lahman baseball database, http://www.baseball1.com/
In addition to the data set above, the book Curve Ball, by Albert, J. and Bennett, J., Copernicus Books, gives an extensive statistical analysis of baseball.
See http://www.baseball-almanac.com/stats.shtml for definitions of common baseball statistics.
data(batting) attach(batting) BA = H/AB # batting average OBP = (H + BB + HBP) / (AB + BB + HBP + SF) # On base "percentage"