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.
baseballr
PackageFor 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:
Removed all columns with only NA values.
Grouped event and description columns for different types of strikeouts, so strikeout descriptions in the resulting column include whether the strikeout was swinging, looking, or other (a catch-all for foul bunts, dropped third strikes, etc.).
Added an at-bat column to keep track of the number of at-bats per player per game (at-bat #1, #2, etc.).
Grouped pitch types into general categories: Fastball, Breaking Ball, and Changeup.
Grouped strike out zones, which were initially divided into 14 regions: Inside, Outside, Middle, and Out of Zone.
After preprocessing, each observation had 88 variables, such as:
Game Year, Game Date, Game Type (Spring Training, Regular Season)
Pitcher and Batter Identifiers (Name, Unique ID, Handiness)
Game Information (Score, Outs, Runners On-Base, Inning)
Pitch Information (Pitch Type, Pitch Location, Pitch Outcome)
Positional (Shifting) Data
We grouped the infield fielding alignments into two categories to reduce the number of shift identifiers:
Strategic and Standard were grouped into Standard: Since strategic shifts are only āslightā variations of traditional alignment and do not encapsulate the focus of our analysis.
Infield shift was reclassified as Shift.
Player Statistics (wOBA, BABIP)
After preprocessing, we also added several additional variables:
Last_pitch_of_at_bat: A true/false identifier that allowed us to filter observations by at-bat.
Babip_value_with_NAs: We replaced batted-ball outcomes that BABIP drops (homeruns, sac bunts, double play sac bunts) with NA values, excluding them from our BABIP calculation.
Batter_instance_identifier: A single-line identifier that groups batter ID, year, stand, and fielding alignment, which allows for easy matching when manipulating dataframes.
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.
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:
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ā.
BABIP follows a very similar trend between right-handed hitters and left-hand hitters, decreasing when each type of batter faces the shift.
This coincides with the tendency observed by Zachary Rymer of Bleacher Report, as mentioned previously: hit rate on hard-hit balls is down over the last eight seasons.
Such a trend alludes to the idea that the primary factor in the right-handed batter phenomenon may not (directly) involve batted balls.
In most instances, the shift is effective against left-handed batters, as indicated by the decrease (or no change) seen in wOBA for such hitters.
However, there is a relatively significant increase in wOBA for right-handed batters when they are shifted against, highlighting that right-handed hitters are finding a way to beat the shift.
Given that wOBA follows an opposite trend as BABIP, this reinforces the notion that factors outside of batted balls could convey how right-handed hitters are beating the shift.
Prior to modeling, we decided to create a more descriptive value capturing a playerās wOBA:
Rather than looking at differences in wOBA as an average across each season, we elected to calculate the delta value of wOBA at the batter level between shifted and non-shifted plate appearances.
To weigh the delta values by the quantity of plate appearances, we used the harmonic mean:
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:
Year
Pitch Type - Fastball, Changeup, and Breaking-Ball
Infield Fielding Alignment
Strikezone Location - Inside, Middle, Outside, or Out of the Zone
Batter/Pitcher Matchup by Handedness
The Interaction Between Batter Stand, Pitcher Handedness, and Infield Alignment
Batterās Harmonic Mean Delta wOBA Value
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.
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.
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.
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.
However, this did convey that the explanation for why right-handed hitters exhibit different behavior may not involve batted ball events.
This notion was reinforced by the differences in wOBA, as wOBA accounts for other ways of getting on base beyond batted balls.
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.
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.
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.
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.
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.
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.