Introduction

Per MLB, shifting describes the situational defensive realignment of fielders away from their ā€œtraditionalā€ (or for our purposes, standard) starting positions. Given that most recent discussion around shifting has been focused on defensive movement in the infield, we will center our analysis on the infield. Statcast defines infield positioning in three ways:

1. Standard - The infield is in their traditional positions.

2. Infield Shift - Three or more infielders are positioned on one side of second base.

3. Strategic - A catch-all category for positioning that does not fit either category.

In recent years, the shift has become the topic of heated debate in the baseball world. As use of the shift has increased, the number of people in opposition has grown as well. The counterargument is built on the idea that the shift ā€œstealsā€ hits at a rate that puts hitters at a significant disadvantage, relative to the defense. According to Zachary Rymer of Bleacher Report, between 2015 and 2016, hard hit balls (exit velocity of 95+ MPH) to the pull side resulted in a hit 58 percent of the time. This number is down to 50 percent for 2020 and 2021, with left-handed hitters suffering more than their right-handed counterparts. Shifting trends are observed to be different for right-handed hitters, a phenomenon that will serve as the main motivation for our work.

Tom Tango looks into this in The Psychology of the Infield Shift, highlighting that wOBA is the main differentiator between the shiftā€™s effect on righties versus lefties. Similar to on-base percentage, wOBA expands further to account for how a player reached base. The value for each way of reaching base is determined by how much an event is worth relative to projected runs scored, so some outcomes (doubles) are worth more than others (singles). In Tangoā€™s work, lefties displayed a lower wOBA when shifted against, while wOBA increases for righties, both relative to non-shifted situations. We will also look into BABIP which measures batting average exclusively on balls in play, excluding several batted-ball outcomes that do not involve the influence of the defense, such as homeruns. However, given the right-handed hitter phenomenon, wOBA is the primary statistic of interest for our analysis.

The baseballr Package

For our work, we accessed pitch-by-pitch Statcast data from the baseballR package (Bill Petti). This dataset contained pitch-level information dating back to 2015, when Statcast technology was introduced in all 30 MLB stadiums, up to July 13th, 2022, which we declared the current seasonā€™s cutoff. The initial dataset had 93 variables per observation; however, during preprocessing, we performed several transformations to prepare the dataset for analysis:

After preprocessing, each observation had 88 variables, such as:

After preprocessing, we also added several additional variables:

In order to promote consistency within our analysis, we decided to observe individual years with assumed independence. Thus, players who had 200 or more plate appearances in multiple years were included as separate player instances. We used 200 as our threshold for at bats because it allows for the calculation of more stable performance statistics for each player.

In order to account for switch hitters, we prefaced that the threshold of 200 or more plate appearances must be observed with a particular batting stance within a single season. If, for example, we observe a particular player with 200 or more at bats as a left-handed batter in addition to 200 or more at bats as a right-handed batter within a single season, this player will be included as two separate observations according to their stance. Given that both the 2020 season (60 games played) and the 2022 season (~90 games played as of July 13th, 2022) have significantly fewer observations using this threshold, we elected to exclude these years from our analysis.

EDA

While the MLB has had a steady rise in shifting overall, left-handed batters see the shift in a significantly higher proportion of their plate appearances than that of right-handed batters.

REMOVING GAMES: During initial EDA, we discovered a high proportion of missing shift values in the Spring Training pitch data (~78%), as well as a low proportion of missing shift values in the Regular Season (~0.01%). From this, we chose to exclude the Spring Training data from each year, and all observations with missing shift values in either the infield or outfield alignment column.

OUTFIELD ALIGNMENTS: Within each batter-pitcher matchup, the proportion of observations in which the outfield is shifted is relatively low, regardless of the alignment of the infield. According to MLB.com, both cases we classify as a shifted outfield - Three OF on One Side of 2B and 4th Outfielder - are considered extremely. Strategic shifting, which we group with Standard, only account for 7% of all situations, with the rest falling under the Standard. This, in addition to Dr. Brodieā€™s advice on which situations exhibit the most prominent shifting influences, led us to focus primarily on infield shifting alignment.

INFIELD-IN: In situations with a runner on third base and less than two outs, the infield may be shifted in. The strategic shift category contains a significant proportion of these scenarios - about 17% each of strategic-standard and strategic-strategic observations (infield-outfield). These situations often inflate offensive outcomes, as moving the infield-in shift promotes variance in run scoring to maximize win probability at the expense of expected runs allowed. To confirm this phenomenon, we looked at the differences in four offensive statistics - wOBA, BABIP, walk rate, and strikeout rate - between infield-in and non-infield-in situations. We used confidence intervals to verify that the differences were statistically significant:

Confidence Intervals

2.5 % 97.5 %
(Intercept) 0.3623651 0.37457
2.5 % 97.5 %
(Intercept) 0.3354222 0.3404923

To adjust for the influence of such situations, we decided to remove observations in which the infield could be shifted in. However, to ensure we were not excluding situations in which there was a runner on third base with less than two outs but the infield was not shifted in, we only removed the observations that fit the aforementioned condition and were marked as ā€œshiftā€.

Methodology

Prior to modeling, we decided to create a more descriptive value capturing a playerā€™s wOBA:

For our methodology, we focused on the trends of two offensive statistics: wOBA and BABIP. Both were provided at the pitch level, but we only focused on each value at the end of an at-bat, as those instances involved the actual effect of the shift, and at the seasonal level.

Our first instinct was to try fitting a linear model to decribe at bat level wOBA values. To model offensive outcomes at the at-bat level, we used several explanatory variables and interactions:

However, as we assessed the conditions for this model, we realized that at bat level wOBA could not be modeled effectively by a linear model because it is not a continuous variable. Although it is numeric, it is discrete with different values corresponding to different at bat outcomes. In the residual plot below, we observed various linear patterns in the residuals. This prompted us to consider other methods of quantifying at bat outcomes.

Quantifying At-Bat Outcomes

First we considered what we consider to be a successful at bat. We contemplated whether we should consider any method of getting on base or only batted balls. However, because any method of reaching a base is considered a success for the offensive team, we decided that getting on base would be considered a successful at bat outcome. Alternatively, we considered not getting on base to be an unsuccessful at bat outcome. Since we were able to reduce at bat outcomes to be binomial, this led us to the logistic regression.

Logistic - Binary At-Bat Outcomes

We used a logistic regression model as a way to predict whether an at bat would be successful based on at bat level characteristics. If the batter successfully made it on base, we interpreted this as our positive outcome; if they got out, this was our negative outcome.

As this model was our follow up to the aforementioned linear model, we included the same variables describing the at bat such as whether there was a shift, the batterā€™s stance, pitcher handedness, pitch location, etc. The harmonic mean weighted delta wOBA value was used as an indicator of player skill on the season.

To assess the fit of our logistic model to our data, we plotted our predicted probability of a successful at bat versus the observed probability of a successful at bat:

From this plot, we observed that our logistic regression resulted in three distinct groupings. It was evident that for both low and high probabilities of getting on base, our model was underpredicting and for moderate probabilities of getting on base our model was overpredicting.

Initially, we completed further EDA to determine if these groupings were influences by any levels of the categorical variables included in our model. However, none of such variables included in our model had three levels, so we quickly moved on to figuring out what else might be causing these relationships. This, we have started exploring but will discuss further as a part of our future work.

Results

As of yet, our modeling largely has inconclusive results.

However, because of the motivation of this project being inference rather that predictability, many of our questions were touched upon through our exploration of the data. Especially since we were concerned with the differences between the outcomes of shifting for right-handed and left-handed batters, by plotting various trends over time we were able to visualize patterns.

As we examined the reasoning for the widely accepted claim ā€œshifts generally work better for left-handed batters and largely donā€™t work for right-handed battersā€, we observed that the BABIP trends between both handedness of hitters did not reflect this. In both instances, hitters seeing the shift had a lower average BABIP.

To further examine why right-handed batters generally do better against the shift, we conclude that we must examine swing behavior and how it relates to the pitches thrown during shifted plays.

Discussion

Limitations

We encountered several limitations with our exploratory work:

  • We elected to exclude observations from both 2020 and 2022, as both years did not include a full seasonā€™s worth of pitch data, and thus did not sufficiently represent year-long trends.

  • The shifting categories are very broad and the differences between shift groupings is not distinct. Similarly, we did not have player positional information. Both of these limited our overall understanding of the specifics of each shift.

  • Due to how we have handled players playing for multiple seasons and switch hitters we have violated independence assumptions. Because of this, we must be careful in assessing our conclusions.

  • Time was a noticeable constraint, especially given the size of the dataset and the several branches of questions we encountered.

Future Work

  1. We have considered within-batter matching (more specifically, propensity score matching) to further enhance our understanding of shifting trends and tendencies. This work would look into the probability of a shift taking place, thus better helping in-game decisions. It would also take into account the factors that influence the potential for a shift and help us look into what motivates a shift, controlled by batter.

  2. From our miscalibrated logistic regression, we concluded that the log-odds probability of getting on base could not be captured by a general linear model. Initially, we were attempting to fit a nonlinear trend with a linear model. In this instance, the model will find the line with the best approximation, but it will be locally biased. The resulting pattern is sigmoidal, due to the transformation the results are passed through.

    • We have since started looking into two-step modeling to address this issue. From here, we were able to adjust the model using smooth nonlinear optimization - a GAM model.

    • By running the untransformed logit output from our initial logistic regression through a nonlinear logistic model, we are better able to fit the trend of the log-odds of getting on base. Thus, we are proceeding by including the second step of passing our initial fitted values into a GAM function.

    • The resulting predicted probability of getting on base versus observed probability of getting on base plot eliminates the three distinct groupings seen earlier.

Logistic Regression with the Added GAM Model

  • Additionally, we have begun looked into the breakdown of this predicted versus observed relationship by batter handedness and shift occurrence. However, we have not gotten as far as interpreting their patterns in context. This is why we include this as a part of our future work.

Observing the Residual Patterns by Batter-Handedness and In-Field Alignment

  • In the future, we would like to assess whether utilizing the two-step modeling with GAM behaves better on out of sample data. We would also like to try to isolate the reasons why there appears to be different patterns for over- and under-predicting for different shift use and batter handedness.
  1. Lastly, as we observed the limited results we were getting by looking at all at bats by batters with over 200 at bats, we came up with the idea of isolating the influences on shifted plays only by only looking at such shifted plays. By restricting our sample in this way, the effects of the predictors would only be affecting the success of the of the shift. In a way, we would be trying to isolate which factors make shifts successful or unsuccessful in comparison to other shifted plays rather than plays in general.

    • Using this sample to assess shifts for right-handed batters versus left-handed batters might be more insightful on determining why shifts are generally less successful.

Acknowledgements

We would like to thank Dr. Adam Brodie for pitching this project idea to us and for taking the time to meet with us and offer guidance along the way. Also, thank you to Dr. Ron Yurko for directing this program and for all the help and suggestions along the way.

References

Baseball Savant

Bill Pettiā€™s baseballR Package

Glossary of Shifting Terms - MLB