Assignment 15

Bosco M Morales

Sports Analytics w/Prof. Norge

Spring 2025

# Read CSV file
baseball = read.csv("baseball.csv")
# View baseball data
baseball
Data Dictionary | MLB
  1. Team: Code or abbreviation representing the team name.

  2. League: Major League Baseball league to which the team belongs, either AL (American League) or NL (National League).

  3. Year: The season year corresponding to the record.

  4. RS (Runs Scored): Total number of runs scored by the team during the season.

  5. RA (Runs Allowed): Total number of runs allowed by the team during the season.

  6. W (Wins): Total number of regular season wins by the team.

  7. OBP (On-Base Percentage): Team’s on-base percentage for the season.

  8. SLG (Slugging Percentage): Team’s slugging percentage for the season.

  9. BA (Batting Average): Team’s batting average for the season.

  10. Playoffs: Indicator of whether the team qualified for the playoffs (1 = Yes, 0 = No).

  11. RankSeason: Rank of the team’s regular season record among playoff teams (1 = best record).

  12. RankPlayoffs: Team’s final standing in the playoffs among all playoff teams (1 = World Series champion).

  13. G (Games Played): Total number of games played by the team during the season.

  14. OOBP (Opponent On-Base Percentage): Combined on-base percentage of all opponents faced by the team.

  15. OSLG (Opponent Slugging Percentage): Combined slugging percentage of all opponents faced by the team.

1. How many team/year pairs are there in the whole data set?
#Each row in the baseball dataset represents a team in a particular year.
#How many team/year pairs are there in the whole data set?

nrow(baseball)
[1] 1232

There are 1,232 pairs of team/year in the baseball data set.

2. Using the table() function, identify the total number of years included in the data set.
# Though the data set contains data from 1962 to 2012. Several years were removed because they contained shorter-than usual seasons.
table(baseball$Year)

1962 1963 1964 1965 1966 1967 1968 1969 1970 1971 1973 1974 1975 1976 1977 1978 1979 
  20   20   20   20   20   20   20   24   24   24   24   24   24   24   26   26   26 
1980 1982 1983 1984 1985 1986 1987 1988 1989 1990 1991 1992 1993 1996 1997 1998 1999 
  26   26   26   26   26   26   26   26   26   26   26   26   28   28   28   30   30 
2000 2001 2002 2003 2004 2005 2006 2007 2008 2009 2010 2011 2012 
  30   30   30   30   30   30   30   30   30   30   30   30   30 

3. Count the number of years in the table

#The baseball data set contains 47 years (1972, 1981, 1994, and 1995 are missing). 
length(table(baseball$Year))
[1] 47

There are 47 years represented in our data set.

Limiting to Teams Making the Playoffs

Because we’re only analyzing teams that made the playoffs, we can use the subset() function to replace baseball with a data frame limited to teams that made the playoffs (so our subsetted data frame should still be called “baseball”).

How many team/year pairs are included in the filtered data set?

baseball = subset(baseball_df, Playoffs == 1)

nrow(baseball)
[1] 244

There are 244 pairs of team/year in the baseball subset data set for those teams that made it to the playoffs.

#Through the years, different numbers of teams have been invited to the playoffs.
table(baseball$Year)

1962 1963 1964 1965 1966 1967 1968 1969 1970 1971 1973 1974 1975 1976 1977 1978 1979 
   2    2    2    2    2    2    2    4    4    4    4    4    4    4    4    4    4 
1980 1982 1983 1984 1985 1986 1987 1988 1989 1990 1991 1992 1993 1996 1997 1998 1999 
   4    4    4    4    4    4    4    4    4    4    4    4    4    8    8    8    8 
2000 2001 2002 2003 2004 2005 2006 2007 2008 2009 2010 2011 2012 
   8    8    8    8    8    8    8    8    8    8    8    8   10 
# The number of teams in the postseason has changed.
table(table(baseball$Year))

 2  4  8 10 
 7 23 16  1 

Adding an Important Predictor

It’s much harder to win the World Series if there are 10 teams competing for the championship versus just two. Therefore, we will add the predictor variable NumCompetitors to the baseball data frame. NumCompetitors will contain the number of total teams making the playoffs in the year of a particular team/year pair. For instance, NumCompetitors should be 2 for the 1962 New York Yankees, but it should be 8 for the 1998 Boston Red Sox.

# We start by storing the output of the table() function that counts the number of playoff teams from each year:

PlayoffTable = table(baseball$Year)

# Output PlayoffTable
PlayoffTable

1962 1963 1964 1965 1966 1967 1968 1969 1970 1971 1973 1974 1975 1976 1977 1978 1979 
   2    2    2    2    2    2    2    4    4    4    4    4    4    4    4    4    4 
1980 1982 1983 1984 1985 1986 1987 1988 1989 1990 1991 1992 1993 1996 1997 1998 1999 
   4    4    4    4    4    4    4    4    4    4    4    4    4    8    8    8    8 
2000 2001 2002 2003 2004 2005 2006 2007 2008 2009 2010 2011 2012 
   8    8    8    8    8    8    8    8    8    8    8    8   10 
str (names(PlayoffTable))
 chr [1:47] "1962" "1963" "1964" "1965" "1966" "1967" "1968" "1969" "1970" "1971" ...
# View the number of teams in the playoffs of 1990 and 2001
PlayoffTable[c("1990", "2001")]

1990 2001 
   4    8 

Putting it all together, we want to look up the number of teams in the playoffs for each team/year pair in the dataset, and store it as a new variable named NumCompetitors in the baseball data frame.

baseball$NumCompetitors = PlayoffTable[as.character(baseball$Year)]

baseball$NumCompetitors
  [1] 10 10 10 10 10 10 10 10 10 10  8  8  8  8  8  8  8  8  8  8  8  8  8  8  8  8  8
 [28]  8  8  8  8  8  8  8  8  8  8  8  8  8  8  8  8  8  8  8  8  8  8  8  8  8  8  8
 [55]  8  8  8  8  8  8  8  8  8  8  8  8  8  8  8  8  8  8  8  8  8  8  8  8  8  8  8
 [82]  8  8  8  8  8  8  8  8  8  8  8  8  8  8  8  8  8  8  8  8  8  8  8  8  8  8  8
[109]  8  8  8  8  8  8  8  8  8  8  8  8  8  8  8  8  8  8  8  8  8  8  8  8  8  8  8
[136]  8  8  8  4  4  4  4  4  4  4  4  4  4  4  4  4  4  4  4  4  4  4  4  4  4  4  4
[163]  4  4  4  4  4  4  4  4  4  4  4  4  4  4  4  4  4  4  4  4  4  4  4  4  4  4  4
[190]  4  4  4  4  4  4  4  4  4  4  4  4  4  4  4  4  4  4  4  4  4  4  4  4  4  4  4
[217]  4  4  4  4  4  4  4  4  4  4  4  4  4  4  2  2  2  2  2  2  2  2  2  2  2  2  2
[244]  2
#How many playoff team/year pairs are there in our dataset from years where 8 teams were invited to the playoffs?
table(baseball$NumCompetitors)

  2   4   8  10 
 14  92 128  10 

Bivariate Models for Predicting World Series Winner

In this problem, we seek to predict whether a team won the World Series; in our data set this is denoted with a RankPlayoffs value of 1. Add a variable named WorldSeries to the baseball data frame, by typing the following command in your R console:

baseballWorldSeries=as.numeric(baseball RankPlayoffs == 1)

WorldSeries takes value 1 if a team won the World Series in the indicated year and a 0 otherwise.

#How many observations do we have in our data set where a team did NOT win the World Series?
baseball$WorldSeries = as.numeric(baseball$RankPlayoffs == 1)

table(baseball$WorldSeries)

  0   1 
197  47 

There are 197 observations where teams did not win a World Series

Which of the following variables is a significant predictor of the WorldSeries variable in a bivariate logistic regression model?

When we’re not sure which of our variables are useful in predicting a particular outcome, it’s often helpful to build bivariate models, which are models that predict the outcome using a single independent variable.

To determine significance, remember to look at the stars in the summary output of the model. We’ll define an independent variable as significant if there is at least one star at the end of the coefficients row for that variable (this is equivalent to the probability column having a value smaller than 0.05). Note that you have to build 12 models to answer this question! Use the entire baseball data set to build the models.

Which of the following variables is a significant predictor of the WorldSeries variable in a bivariate logistic regression model?

Varibales to use as predictors for each bivariate model(Year, RS, RA, W, OBP, SLG, BA, RankSeason, OOBP,OSLG, NumCompetitors, League)

Model 1

# Which of the following variables is a significant predictor of the WorldSeries variable in a bivariate logistic regression model?

# Varibales to use as predictors for each bivariate model(Year, RS, RA, W, OBP, SLG, BA, RankSeason, OOBP,OSLG, NumCompetitors, League)

model1<-glm(WorldSeries~Year, data=baseball, family="binomial")

summary(model1)

Call:
glm(formula = WorldSeries ~ Year, family = "binomial", data = baseball)

Coefficients:
            Estimate Std. Error z value Pr(>|z|)   
(Intercept) 72.23602   22.64409    3.19  0.00142 **
Year        -0.03700    0.01138   -3.25  0.00115 **
---
Signif. codes:  0 ‘***’ 0.001 ‘**’ 0.01 ‘*’ 0.05 ‘.’ 0.1 ‘ ’ 1

(Dispersion parameter for binomial family taken to be 1)

    Null deviance: 239.12  on 243  degrees of freedom
Residual deviance: 228.35  on 242  degrees of freedom
AIC: 232.35

Number of Fisher Scoring iterations: 4

Model 2

model2<-glm(WorldSeries~RS, data=baseball, family="binomial")

summary(model2)

Call:
glm(formula = WorldSeries ~ RS, family = "binomial", data = baseball)

Coefficients:
             Estimate Std. Error z value Pr(>|z|)
(Intercept)  0.661226   1.636494   0.404    0.686
RS          -0.002681   0.002098  -1.278    0.201

(Dispersion parameter for binomial family taken to be 1)

    Null deviance: 239.12  on 243  degrees of freedom
Residual deviance: 237.45  on 242  degrees of freedom
AIC: 241.45

Number of Fisher Scoring iterations: 4

Model 3

model3<-glm(WorldSeries~RA, data=baseball, family="binomial")

summary(model3)

Call:
glm(formula = WorldSeries ~ RA, family = "binomial", data = baseball)

Coefficients:
             Estimate Std. Error z value Pr(>|z|)  
(Intercept)  1.888174   1.483831   1.272   0.2032  
RA          -0.005053   0.002273  -2.223   0.0262 *
---
Signif. codes:  0 ‘***’ 0.001 ‘**’ 0.01 ‘*’ 0.05 ‘.’ 0.1 ‘ ’ 1

(Dispersion parameter for binomial family taken to be 1)

    Null deviance: 239.12  on 243  degrees of freedom
Residual deviance: 233.88  on 242  degrees of freedom
AIC: 237.88

Number of Fisher Scoring iterations: 4

Model 4

model4<-glm(WorldSeries~W, data=baseball, family="binomial")

summary(model4)

Call:
glm(formula = WorldSeries ~ W, family = "binomial", data = baseball)

Coefficients:
            Estimate Std. Error z value Pr(>|z|)  
(Intercept) -6.85568    2.87620  -2.384   0.0171 *
W            0.05671    0.02988   1.898   0.0577 .
---
Signif. codes:  0 ‘***’ 0.001 ‘**’ 0.01 ‘*’ 0.05 ‘.’ 0.1 ‘ ’ 1

(Dispersion parameter for binomial family taken to be 1)

    Null deviance: 239.12  on 243  degrees of freedom
Residual deviance: 235.51  on 242  degrees of freedom
AIC: 239.51

Number of Fisher Scoring iterations: 4

Model 5

model5<-glm(WorldSeries~OBP, data=baseball, family="binomial")

summary(model5)

Call:
glm(formula = WorldSeries ~ OBP, family = "binomial", data = baseball)

Coefficients:
            Estimate Std. Error z value Pr(>|z|)
(Intercept)    2.741      3.989   0.687    0.492
OBP          -12.402     11.865  -1.045    0.296

(Dispersion parameter for binomial family taken to be 1)

    Null deviance: 239.12  on 243  degrees of freedom
Residual deviance: 238.02  on 242  degrees of freedom
AIC: 242.02

Number of Fisher Scoring iterations: 4

Model 6

model6<-glm(WorldSeries~SLG, data=baseball, family="binomial")

summary(model6)

Call:
glm(formula = WorldSeries ~ SLG, family = "binomial", data = baseball)

Coefficients:
            Estimate Std. Error z value Pr(>|z|)  
(Intercept)    3.200      2.358   1.357   0.1748  
SLG          -11.130      5.689  -1.956   0.0504 .
---
Signif. codes:  0 ‘***’ 0.001 ‘**’ 0.01 ‘*’ 0.05 ‘.’ 0.1 ‘ ’ 1

(Dispersion parameter for binomial family taken to be 1)

    Null deviance: 239.12  on 243  degrees of freedom
Residual deviance: 235.23  on 242  degrees of freedom
AIC: 239.23

Number of Fisher Scoring iterations: 4

Model 7

model7<-glm(WorldSeries~BA, data=baseball, family="binomial")

summary(model7)

Call:
glm(formula = WorldSeries ~ BA, family = "binomial", data = baseball)

Coefficients:
            Estimate Std. Error z value Pr(>|z|)
(Intercept)  -0.6392     3.8988  -0.164    0.870
BA           -2.9765    14.6123  -0.204    0.839

(Dispersion parameter for binomial family taken to be 1)

    Null deviance: 239.12  on 243  degrees of freedom
Residual deviance: 239.08  on 242  degrees of freedom
AIC: 243.08

Number of Fisher Scoring iterations: 4

Model 8

model8<-glm(WorldSeries~RankSeason, data=baseball, family="binomial")

summary(model8)

Call:
glm(formula = WorldSeries ~ RankSeason, family = "binomial", 
    data = baseball)

Coefficients:
            Estimate Std. Error z value Pr(>|z|)  
(Intercept)  -0.8256     0.3268  -2.527   0.0115 *
RankSeason   -0.2069     0.1027  -2.016   0.0438 *
---
Signif. codes:  0 ‘***’ 0.001 ‘**’ 0.01 ‘*’ 0.05 ‘.’ 0.1 ‘ ’ 1

(Dispersion parameter for binomial family taken to be 1)

    Null deviance: 239.12  on 243  degrees of freedom
Residual deviance: 234.75  on 242  degrees of freedom
AIC: 238.75

Number of Fisher Scoring iterations: 4

Model 9

model9<-glm(WorldSeries~OOBP, data=baseball, family="binomial")

summary(model9)

Call:
glm(formula = WorldSeries ~ OOBP, family = "binomial", data = baseball)

Coefficients:
            Estimate Std. Error z value Pr(>|z|)
(Intercept)  -0.9306     8.3728  -0.111    0.912
OOBP         -3.2233    26.0587  -0.124    0.902

(Dispersion parameter for binomial family taken to be 1)

    Null deviance: 84.926  on 113  degrees of freedom
Residual deviance: 84.910  on 112  degrees of freedom
  (130 observations deleted due to missingness)
AIC: 88.91

Number of Fisher Scoring iterations: 4

Model 10

model10<-glm(WorldSeries~OSLG, data=baseball, family="binomial")

summary(model10)

Call:
glm(formula = WorldSeries ~ OSLG, family = "binomial", data = baseball)

Coefficients:
            Estimate Std. Error z value Pr(>|z|)
(Intercept) -0.08725    6.07285  -0.014    0.989
OSLG        -4.65992   15.06881  -0.309    0.757

(Dispersion parameter for binomial family taken to be 1)

    Null deviance: 84.926  on 113  degrees of freedom
Residual deviance: 84.830  on 112  degrees of freedom
  (130 observations deleted due to missingness)
AIC: 88.83

Number of Fisher Scoring iterations: 4

Model11

model11<-glm(WorldSeries~NumCompetitors, data=baseball, family="binomial")

summary(model11)

Call:
glm(formula = WorldSeries ~ NumCompetitors, family = "binomial", 
    data = baseball)

Coefficients:
               Estimate Std. Error z value Pr(>|z|)    
(Intercept)     0.03868    0.43750   0.088 0.929559    
NumCompetitors -0.25220    0.07422  -3.398 0.000678 ***
---
Signif. codes:  0 ‘***’ 0.001 ‘**’ 0.01 ‘*’ 0.05 ‘.’ 0.1 ‘ ’ 1

(Dispersion parameter for binomial family taken to be 1)

    Null deviance: 239.12  on 243  degrees of freedom
Residual deviance: 226.96  on 242  degrees of freedom
AIC: 230.96

Number of Fisher Scoring iterations: 4

Model 12

model12<-glm(WorldSeries~League, data=baseball, family="binomial")

summary(model12)

Call:
glm(formula = WorldSeries ~ League, family = "binomial", data = baseball)

Coefficients:
            Estimate Std. Error z value Pr(>|z|)    
(Intercept)  -1.3558     0.2243  -6.045  1.5e-09 ***
LeagueNL     -0.1583     0.3252  -0.487    0.626    
---
Signif. codes:  0 ‘***’ 0.001 ‘**’ 0.01 ‘*’ 0.05 ‘.’ 0.1 ‘ ’ 1

(Dispersion parameter for binomial family taken to be 1)

    Null deviance: 239.12  on 243  degrees of freedom
Residual deviance: 238.88  on 242  degrees of freedom
AIC: 242.88

Number of Fisher Scoring iterations: 4

In short, the significant predictors are Year, RA, and NumCompetitors.

Multivariate Models for Predicting World Series Winner

In this section, we’ll consider multivariate models that combine the variables we found to be significant in bivariate models. Build a model using all of the variables that you found to be significant in the bivariate models. How many variables are significant in the combined model?

#How many variables are significant in the combined model?

LogModel = glm(WorldSeries ~ Year + RA + RankSeason + NumCompetitors, data=baseball, family=binomial)
summary(LogModel)

Call:
glm(formula = WorldSeries ~ Year + RA + RankSeason + NumCompetitors, 
    family = binomial, data = baseball)

Coefficients:
                 Estimate Std. Error z value Pr(>|z|)
(Intercept)    12.5874376 53.6474210   0.235    0.814
Year           -0.0061425  0.0274665  -0.224    0.823
RA             -0.0008238  0.0027391  -0.301    0.764
RankSeason     -0.0685046  0.1203459  -0.569    0.569
NumCompetitors -0.1794264  0.1815933  -0.988    0.323

(Dispersion parameter for binomial family taken to be 1)

    Null deviance: 239.12  on 243  degrees of freedom
Residual deviance: 226.37  on 239  degrees of freedom
AIC: 236.37

Number of Fisher Scoring iterations: 4

Looking at summary(LogModel), we can see that none of the variables are significant in the multivariate model. Often, variables that were significant in bivariate models are no longer significant in multivariate analysis due to correlation between the variables. Which of the following variable pairs have a high degree of correlation (a correlation greater than 0.8 or less than -0.8)?

#We can compute all pair-wise correlations between these variables with:
cor(baseball[c("Year", "RA", "RankSeason", "NumCompetitors")])
                    Year        RA RankSeason NumCompetitors
Year           1.0000000 0.4762422  0.3852191      0.9139548
RA             0.4762422 1.0000000  0.3991413      0.5136769
RankSeason     0.3852191 0.3991413  1.0000000      0.4247393
NumCompetitors 0.9139548 0.5136769  0.4247393      1.0000000

While every pair was at least moderately correlated, the only strongly correlated pair was Year/NumCompetitors, with correlation coefficient 0.914.

Let us build all six of the two variable models listed in the previous problem. Together with the four bivariate models that were significant, we should have 10 different logistic regression models to analyze. Which model has the best AIC value (the minimum AIC value)?

#The two-variable models can be built with the following commands:

model13 = glm(WorldSeries ~ Year + RA, data=baseball, family=binomial)

summary(model13)

Call:
glm(formula = WorldSeries ~ Year + RA, family = binomial, data = baseball)

Coefficients:
             Estimate Std. Error z value Pr(>|z|)  
(Intercept) 63.610741  25.654830   2.479   0.0132 *
Year        -0.032084   0.013323  -2.408   0.0160 *
RA          -0.001766   0.002585  -0.683   0.4945  
---
Signif. codes:  0 ‘***’ 0.001 ‘**’ 0.01 ‘*’ 0.05 ‘.’ 0.1 ‘ ’ 1

(Dispersion parameter for binomial family taken to be 1)

    Null deviance: 239.12  on 243  degrees of freedom
Residual deviance: 227.88  on 241  degrees of freedom
AIC: 233.88

Number of Fisher Scoring iterations: 4
model14 = glm(WorldSeries ~ Year + RankSeason, data=baseball, family=binomial)

summary(model14)

Call:
glm(formula = WorldSeries ~ Year + RankSeason, family = binomial, 
    data = baseball)

Coefficients:
            Estimate Std. Error z value Pr(>|z|)   
(Intercept) 63.64855   24.37063   2.612  0.00901 **
Year        -0.03254    0.01231  -2.643  0.00822 **
RankSeason  -0.10064    0.11352  -0.887  0.37534   
---
Signif. codes:  0 ‘***’ 0.001 ‘**’ 0.01 ‘*’ 0.05 ‘.’ 0.1 ‘ ’ 1

(Dispersion parameter for binomial family taken to be 1)

    Null deviance: 239.12  on 243  degrees of freedom
Residual deviance: 227.55  on 241  degrees of freedom
AIC: 233.55

Number of Fisher Scoring iterations: 4
model15 = glm(WorldSeries ~ Year + NumCompetitors, data=baseball, family=binomial)
summary(model15)

Call:
glm(formula = WorldSeries ~ Year + NumCompetitors, family = binomial, 
    data = baseball)

Coefficients:
                Estimate Std. Error z value Pr(>|z|)
(Intercept)    13.350467  53.481896   0.250    0.803
Year           -0.006802   0.027328  -0.249    0.803
NumCompetitors -0.212610   0.175520  -1.211    0.226

(Dispersion parameter for binomial family taken to be 1)

    Null deviance: 239.12  on 243  degrees of freedom
Residual deviance: 226.90  on 241  degrees of freedom
AIC: 232.9

Number of Fisher Scoring iterations: 4
model16 = glm(WorldSeries ~ RA + RankSeason, data=baseball, family=binomial)
summary(model16)

Call:
glm(formula = WorldSeries ~ RA + RankSeason, family = binomial, 
    data = baseball)

Coefficients:
             Estimate Std. Error z value Pr(>|z|)
(Intercept)  1.487461   1.506143   0.988    0.323
RA          -0.003815   0.002441  -1.563    0.118
RankSeason  -0.140824   0.110908  -1.270    0.204

(Dispersion parameter for binomial family taken to be 1)

    Null deviance: 239.12  on 243  degrees of freedom
Residual deviance: 232.22  on 241  degrees of freedom
AIC: 238.22

Number of Fisher Scoring iterations: 4
model17 = glm(WorldSeries ~ RA + NumCompetitors, data=baseball, family=binomial)
summary(model17)

Call:
glm(formula = WorldSeries ~ RA + NumCompetitors, family = binomial, 
    data = baseball)

Coefficients:
                Estimate Std. Error z value Pr(>|z|)   
(Intercept)     0.716895   1.528736   0.469  0.63911   
RA             -0.001233   0.002661  -0.463  0.64313   
NumCompetitors -0.229385   0.088399  -2.595  0.00946 **
---
Signif. codes:  0 ‘***’ 0.001 ‘**’ 0.01 ‘*’ 0.05 ‘.’ 0.1 ‘ ’ 1

(Dispersion parameter for binomial family taken to be 1)

    Null deviance: 239.12  on 243  degrees of freedom
Residual deviance: 226.74  on 241  degrees of freedom
AIC: 232.74

Number of Fisher Scoring iterations: 4
model18 = glm(WorldSeries ~ RankSeason + NumCompetitors, data=baseball, family=binomial)
summary(model18)

Call:
glm(formula = WorldSeries ~ RankSeason + NumCompetitors, family = binomial, 
    data = baseball)

Coefficients:
               Estimate Std. Error z value Pr(>|z|)   
(Intercept)     0.12277    0.45737   0.268  0.78837   
RankSeason     -0.07697    0.11711  -0.657  0.51102   
NumCompetitors -0.22784    0.08201  -2.778  0.00546 **
---
Signif. codes:  0 ‘***’ 0.001 ‘**’ 0.01 ‘*’ 0.05 ‘.’ 0.1 ‘ ’ 1

(Dispersion parameter for binomial family taken to be 1)

    Null deviance: 239.12  on 243  degrees of freedom
Residual deviance: 226.52  on 241  degrees of freedom
AIC: 232.52

Number of Fisher Scoring iterations: 4

None of the models with two independent variables had both variables significant, so none seem promising as compared to a simple bivariate model. Indeed the model with the lowest AIC value is the model with just NumCompetitors as the independent variable. This seems to confirm the claim made by Billy Beane in Moneyball that all that matters in the Playoffs is luck, since NumCompetitors has nothing to do with the quality of the teams!

LS0tCnRpdGxlOiAiV29ybGQgU2VyaWVzIgpvdXRwdXQ6IGh0bWxfbm90ZWJvb2sKLS0tCgojIyMjIEFzc2lnbm1lbnQgIDE1CgpCb3NjbyBNIE1vcmFsZXMKClNwb3J0cyBBbmFseXRpY3Mgdy9Qcm9mLiBOb3JnZQoKU3ByaW5nIDIwMjUKCmBgYHtyfQojIFJlYWQgQ1NWIGZpbGUKYmFzZWJhbGwgPSByZWFkLmNzdigiYmFzZWJhbGwuY3N2IikKYGBgCgpgYGB7cn0KIyBWaWV3IGJhc2ViYWxsIGRhdGEKYmFzZWJhbGwKYGBgCgojIyMjIyAqKkRhdGEgRGljdGlvbmFyeSBcfCBNTEIqKgoKMS4gICoqVGVhbSoqOiBDb2RlIG9yIGFiYnJldmlhdGlvbiByZXByZXNlbnRpbmcgdGhlIHRlYW0gbmFtZS4KCjIuICAqKkxlYWd1ZSoqOiBNYWpvciBMZWFndWUgQmFzZWJhbGwgbGVhZ3VlIHRvIHdoaWNoIHRoZSB0ZWFtIGJlbG9uZ3MsIGVpdGhlciBBTCAoQW1lcmljYW4gTGVhZ3VlKSBvciBOTCAoTmF0aW9uYWwgTGVhZ3VlKS4KCjMuICAqKlllYXIqKjogVGhlIHNlYXNvbiB5ZWFyIGNvcnJlc3BvbmRpbmcgdG8gdGhlIHJlY29yZC4KCjQuICAqKlJTKiogKFJ1bnMgU2NvcmVkKTogVG90YWwgbnVtYmVyIG9mIHJ1bnMgc2NvcmVkIGJ5IHRoZSB0ZWFtIGR1cmluZyB0aGUgc2Vhc29uLgoKNS4gICoqUkEqKiAoUnVucyBBbGxvd2VkKTogVG90YWwgbnVtYmVyIG9mIHJ1bnMgYWxsb3dlZCBieSB0aGUgdGVhbSBkdXJpbmcgdGhlIHNlYXNvbi4KCjYuICAqKlcqKiAoV2lucyk6IFRvdGFsIG51bWJlciBvZiByZW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