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
 [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

What is the correlation between teamRank and wins2012?

# Correlations
cor(teamRank, wins2012)
[1] 0.3477129
teamRank
 [1] 1 2 3 3 4 4 4 4 5 5
wins2012
 [1] 94 88 95 88 93 94 98 97 93 94

In MLB 2012, there is a positive correlation of 0.35 between a team’s ranking and the number of games they win. This means that as the number of wins goes up, the team’s ranking generally improves, but not by a large amount.

What is the correlation between teamRank and wins2013?

# Correlations
cor(teamRank, wins2013)
[1] -0.6556945
teamRank
 [1] 1 2 3 3 4 4 4 4 5 5
wins2012
 [1] 94 88 95 88 93 94 98 97 93 94

there is a negative correlation of -0.66 between a team’s ranking and the number of games they win. This means that as the number of wins decreases, the team’s ranking worsens. Conversely, as the number of wins increases, the team’s ranking improves

In the end, winning the World Series depends on things like team chemistry, player health, handling pressure, and sometimes luck. While Moneyball helps teams succeed and reach the playoffs, predicting the World Series winner involves more than just stats—it’s about many other factors too.

LS0tDQp0aXRsZTogIkluLWNsYXNzIGFjdGl2aXR5ICMxMChIVyk6Q29ycmVsYXRpb24gYmV0d2VlbiBUZWFtcyBSYW5rIGFuZCBXaW5zIg0Kb3V0cHV0OiBodG1sX25vdGVib29rDQotLS0NCg0KSW4gMjAxMiBhbmQgMjAxMywgdGhlcmUgd2VyZSAxMCB0ZWFtcyBpbiB0aGUgTUxCIHBsYXlvZmZzOiB0aGUgc2l4IHRlYW1zIHRoYXQgaGFkIHRoZSBtb3N0IHdpbnMgaW4gZWFjaCBiYXNlYmFsbCBkaXZpc2lvbiwgYW5kIGZvdXIg4oCcd2lsZCBjYXJk4oCdIHRlYW1zLiBUaGUgcGxheW9mZnMgc3RhcnQgYmV0d2VlbiB0aGUgZm91ciB3aWxkIGNhcmQgdGVhbXMgLSB0aGUgdHdvIHRlYW1zIHRoYXQgd2luIHByb2NlZWQgaW4gdGhlIHBsYXlvZmZzICg4IHRlYW1zIHJlbWFpbmluZykuIFRoZW4sIHRoZXNlIHRlYW1zIGFyZSBwYWlyZWQgb2ZmIGFuZCBwbGF5IGEgc2Vy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