batting                package:UsingR                R Documentation

_B_a_t_t_i_n_g _s_t_a_t_i_s_t_i_c_s _f_o_r _2_0_0_2 _b_a_s_e_b_a_l_l _s_e_a_s_o_n

_D_e_s_c_r_i_p_t_i_o_n:

     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 <URL: http://www.baseball1.com/>.

_U_s_a_g_e:

     data(batting)

_F_o_r_m_a_t:

     A data frame with 438 observations on the following 22 variables.

     _p_l_a_y_e_r_I_D This is coded, but those familiar with the players should
          be able to find their favorites.

     _y_e_a_r_I_D a numeric vector. Always 2002 in this dataset.

     _s_t_i_n_t_I_D a numeric vector. Player's stint (order of appearances
          within a season)

     _t_e_a_m_I_D a factor with Team

     _l_g_I_D a factor with levels 'AL' 'NL'

     _G number of games played

     _A_B number of at bats

     _R number of runs

     _H number of hits

     _D_O_U_B_L_E number of doubles. "2B" in original dat a base.

     _T_R_I_P_L_E number of triples. "3B" in original data base

     _H_R number of home runs

     _R_B_I number of runs batted in

     _S_B number of stolen bases

     _C_S number of times caught stealing

     _B_B number of base on balls (walks)

     _S_O number of strikeouts

     _I_B_B number of intentional walks

     _H_B_P number of hit by pitches

     _S_H number of sacrifice hits

     _S_F number of sacrifice flies

     _G_I_D_P number of grounded into double plays

_D_e_t_a_i_l_s:

     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
     <URL: http://www.baseball1.com/>. The complete dataset includes
     data for all of baseball not just the year 2002 presented here.

_S_o_u_r_c_e:

     Lahman baseball database, <URL: http://www.baseball1.com/>

_R_e_f_e_r_e_n_c_e_s:

     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 <URL: http://www.baseball-almanac.com/stats.shtml> for
     definitions of common baseball statistics.

_E_x_a_m_p_l_e_s:

     data(batting)
     attach(batting)
     BA = H/AB                       # batting average
     OBP = (H + BB + HBP) / (AB + BB + HBP + SF) # On base "percentage"

