If a baseball team scores 763 runs and allows 614 runs, how many games do we expect the team to win?
763-614
## [1] 149
Wins = 80.88+0.105766*(149)
Wins
## [1] 96.63913
Result: We expect the team to win approximately 97 games.
Exercise 1: If a baseball team’s OBP is 0.361, SLG is 0.409, and BA is 0.257, how many runs do we expect the team to score?
RunsScored = -788.46+2917.42*(0.361)+1637.93*(0.409)-368.97*(0.257)
RunsScored
## [1] 839.8167
Result: We expect the team to score about 840 runs.
Exercise 2: If a baseball team’s opponents OBP (OOBP) is 0.267 and opponents SLG (OSLG) is 0.392, how many runs do we expect the team to allow?
RunsAllowed = -837.38+2913.60*(0.267)+1514.29*(0.392)
RunsAllowed
## [1] 534.1529
Result: We expect the team to allow 534 runs.
Suppose you are the General Manager of a baseball team, and you are selecting two players for your team. You have a budget of $10,500,000, and you have the choice between the following players:
#Player Name OBP SLG Salary
#Yandy Diaz 0.403 0.511 $8,000,000
#Joey Meneses 0.320 0.366 $723,600
#Jose Abreu 0.292 0.358 $19,500,000
#Ryan Noda 0.384 0.400 $720,000
#Nate Lowe 0.365 0.426 $4,050,000
Given your budget and the player statistics, which two players would you select?
Result: Yandy Diaz, Ryan Noda
In 2012 and 2013, there were 10 teams in the MLB playoffs: the six teams that had the most wins in each baseball division, and four “wild card” teams. The playoffs start between the four wild card teams - the two teams that win proceed in the playoffs (8 teams remaining). Then, these teams are paired off and play a series of games. The four teams that win are then paired and play to determine who will play in the World Series. We can assign rankings to the teams as follows:
Rank 1: the team that won the World Series Rank 2: the team that lost the World Series Rank 3: the two teams that lost to the teams in the World Series Rank 4: the four teams that made it past the wild card round, but lost to the above four teams Rank 5: the two teams that lost the wild card round
In your R console, create a corresponding rank vector by typing teamRank = c(1,2,3,3,4,4,4,4,5,5)
teamRank = c(1,2,3,3,4,4,4,4,5,5)
teamRank
## [1] 1 2 3 3 4 4 4 4 5 5
In this quick question, we’ll see how well these rankings correlate with the regular season wins of the teams. In 2012, the ranking of the teams and their regular season wins were as follows: Rank 1: San Francisco Giants (Wins = 94) Rank 2: Detroit Tigers (Wins = 88) Rank 3: New York Yankees (Wins = 95), and St. Louis Cardinals (Wins = 88) Rank 4: Baltimore Orioles (Wins = 93), Oakland A’s (Wins = 94), Washington Nationals (Wins = 98), Cincinnati Reds (Wins = 97) Rank 5: Texas Rangers (Wins = 93), and Atlanta Braves (Wins = 94)
Create a vector in R called wins2012, that has the wins of each team in 2012, in order of rank (the vector should have 10 numbers).
wins2012 = c(94,88,95,88,93,94,98,97,93,94)
wins2012
## [1] 94 88 95 88 93 94 98 97 93 94
In 2013, the ranking of the teams and their regular season wins were as follows: Rank 1: Boston Red Sox (Wins = 97) Rank 2: St. Louis Cardinals (Wins = 97) Rank 3: Los Angeles Dodgers (Wins = 92), and Detroit Tigers (Wins = 93) Rank 4: Tampa Bay Rays (Wins = 92), Oakland A’s (Wins = 96), Pittsburgh Pirates (Wins = 94), and Atlanta Braves (Wins = 96) Rank 5: Cleveland Indians (Wins = 92), and Cincinnati Reds (Wins = 90)
Create another vector in R called wins2013, that has the wins of each team in 2013, in order of rank (the vector should have 10 numbers).
wins2013 = c(97,97,92,93,92,96,94,96,92,90)
wins2013
## [1] 97 97 92 93 92 96 94 96 92 90
Exercise 1: What is the correlation between teamRank and wins2012?
cor(teamRank,wins2012)
## [1] 0.3477129
Result: A correlation of 0.3477129.
Exercise 2: What is the correlation between teamRank and wins2013?
cor(teamRank,wins2013)
## [1] -0.6556945
Result: A correlation of -0.6556945.
Which of the following is most likely to be a topic of Sabermetric research? Why?
# a.Evaluating how the attitude of managers influences player performance
# b.Determining the correlation between scouting predictions and player performance
# c.Predicting how many home runs the Oakland A's will hit next year
Answer: C. Sabermetrics analyzes baseball through statistics to predict player performance, and forecast results of players and their team based off of previous data.