2023-11-15

Introduction

The word “Analytics” gets used quite often in the current age of professional sports, especially with Major League Baseball (MLB).

Data is collected, stored, processed, and analyzed by every single organization as they continue to invest in their respective analytics and research departments.

The data is used to create game plans in order to get an edge on the competition, as well as grade and scout prospective players, the most valuable asset to the organizations.

The Dataset

Luckily, there is a large collection of player data available to the general public. The dataset used for this analysis is “Major League Baseball Hitting”, which is available on Kaggle.com.

As the 2023 MLB season comes to a close, this set is up to date with the final batting statistics of each qualified professional hitter. The raw data was originally pulled from FanGraphs.com, one of the largest sites used to view player statistics, and keep up with what’s going on in the world of baseball.

The dataset includes only “qualified hitters” defined as hitters who had a minimum of 100 plate appearances in the 2023 season. This is to make sure there was enough statistical data collected to provide an accurate view of a player’s season.

The dataset and its detailed description can be found at: https://www.kaggle.com/datasets/m000sey/major-league-baseball-hitting-data/data

The Dataset (cont)

First things first, the dataset must be imported to R:

library(readr)
batting_2023_data <- read_csv("batting_2023_data.csv")

We already know that each player had a minimum of 100 plate appearances to appear on this list, let’s narrow it down further and look at some information regarding total games played.

summary(batting_2023_data$G)
##    Min. 1st Qu.  Median    Mean 3rd Qu.    Max. 
##    26.0    70.0   107.0   102.4   136.0   162.0

The Dataset (cont)

For the purpose of this analysis, the focus will be on individuals who played in what is relatively considered the “majority” of games. Given that the median of games played was 107, the dataset will be filtered to only contained players who appeared in 107 games or more out of the 162 game season.

library(dplyr)
batting_data_107 <- filter(batting_2023_data, G >= 107)

The revised dataset provides us with 232 observations, roughly half of the original set that contained 461 observations.

Defining The Problem

Plate discipline is an important skill to have as a hitter in baseball. It can be summarized in short by how effective a hitter is at swinging at pitches that are in the strike zone (strikes), and not swinging at pitches that are outside of the strike zone (balls).

The purpose of this analysis is to see if a player’s plate discipline contributes positively to their overall performance.

The Statistics

The statistics used in this analysis are as follows:

  • WAR (Wins Above Replacement): Overall measure of a player’s value. The dependent variable for analysis.

  • OBP (On Base Percentage): Represents a hitter’s ability to get on base.

  • Z-Swing%: Percentage of pitches a batter swings at inside of the strike zone.

  • Barrel%: Percentage of batted balls that are struck well.

  • BB/K: Ratio comparing how many times a batter takes a walk vs strikes out.

OBP vs WAR

Z-Swing% vs WAR

Barrel% vs WAR

BB/K vs WAR

Correlation Testing

OBP vs WAR:

## 
##  Pearson's product-moment correlation
## 
## data:  OBP and WAR
## t = 13.684, df = 230, p-value < 2.2e-16
## alternative hypothesis: true correlation is not equal to 0
## 95 percent confidence interval:
##  0.5922189 0.7352741
## sample estimates:
##       cor 
## 0.6699182

Correlation Testing

Z-Swing% vs WAR:

## 
##  Pearson's product-moment correlation
## 
## data:  ZSwing and WAR
## t = 0.71111, df = 230, p-value = 0.4777
## alternative hypothesis: true correlation is not equal to 0
## 95 percent confidence interval:
##  -0.08245832  0.17458327
## sample estimates:
##        cor 
## 0.04683779

Correlation Testing

Barrel% vs WAR:

## 
##  Pearson's product-moment correlation
## 
## data:  Barrel and WAR
## t = 6.4398, df = 230, p-value = 6.906e-10
## alternative hypothesis: true correlation is not equal to 0
## 95 percent confidence interval:
##  0.2759443 0.4947443
## sample estimates:
##       cor 
## 0.3908516

Correlation Testing

BB/K vs WAR:

## 
##  Pearson's product-moment correlation
## 
## data:  BBK and WAR
## t = 6.1387, df = 230, p-value = 3.612e-09
## alternative hypothesis: true correlation is not equal to 0
## 95 percent confidence interval:
##  0.2589164 0.4807681
## sample estimates:
##       cor 
## 0.3752028

Conclusions

Of all the plate discipline variables tested to see which ones have an influence on a player’s overall performance, it appears that the only insignificant variable is Z-Swing%.

The p-values for the other variables all resulted in less than 0.05, showing that they are statistically significant.

To no surprise, Z-Swing% also resulted in the lowest correlation coefficient of 0.0468, indicating there is little to no relationship between a batter’s ability to swing at strikes and their WAR.