Baseball is a sport where the professional teams in the MLB spend millions of dollars every year with the goal of building a roster that is capable of winning a championship. We see a difference in some teams who are willing to spend a lot of money on superstar talent, versus the teams who rely on developing talent and finding players who can perform at a lower cost. With such drastic differences in team spending, it raises the question of whether or not higher spending actually leads to better performance. According to Sawchik (2026), the five highest paying teams averaged 89 wins per season (55% winning percentage) between 1998 and 2024, compared to 74 wins (46% winning percentage) for the five lowest payroll teams in that same span. As these numbers suggest that spending more is an inherent advantage, it does not always guarantee success. We are interested to see whether teams are getting the most out of their spending and if individual players are really worth what they are getting paid.
To dive further into this question, we will analyze data from the 2024 Major League Baseball season and look at team and individual player performance. At the team level, we are comparing payrolls with total wins, offensive statistics such as home runs and batting average, and pitching statistics such as ERA and strikeouts. At the individual level, we will analyze both pitchers and hitters’ performance using Wins Above Replacement (WAR) in order to calculate a player’s value brought to a team. Comparing WAR with player salaries will help us see whether higher paid players are generally providing more value, or if some lower paid players are providing similar or greater production for their respective teams. Boan (2026) provides us with an example of this type of analysis by comparing salaries with WAR to identify how a player’s value can be calculated through wins per dollar.
Our data comes from publicly available MLB statistics and salary databases, including team batting, team pitching, team payrolls, individual statistics, and individual salaries. Through combining financial data with on field performance, we hope to better understand whether or not spending more money is the best way to generate a successful team, or if some teams and players can produce more without costing as much.
library(readr)
library(tidyverse)
## ── Attaching core tidyverse packages ──────────────────────── tidyverse 2.0.0 ──
## ✔ dplyr 1.2.1 ✔ purrr 1.2.2
## ✔ forcats 1.0.1 ✔ stringr 1.6.0
## ✔ ggplot2 4.0.1 ✔ tibble 3.3.1
## ✔ lubridate 1.9.5 ✔ tidyr 1.3.2
## ── Conflicts ────────────────────────────────────────── tidyverse_conflicts() ──
## ✖ dplyr::filter() masks stats::filter()
## ✖ dplyr::lag() masks stats::lag()
## ℹ Use the conflicted package (<http://conflicted.r-lib.org/>) to force all conflicts to become errors
library(lubridate)
library(dplyr)
library(tidyr)
library(ggplot2)
library(readxl)
# Team datasets
MLB_team_spending_2024 <- read_csv("MLB_team_spending_2024.csv")
## Rows: 32 Columns: 9
## ── Column specification ────────────────────────────────────────────────────────
## Delimiter: ","
## chr (8): Rank, Team, Record, Total PayrollAllocations, Active26-Man, Injured...
## dbl (1): Avg AgeTeam
##
## ℹ Use `spec()` to retrieve the full column specification for this data.
## ℹ Specify the column types or set `show_col_types = FALSE` to quiet this message.
MLB_team_pitching_2024 <- read_csv("mlb_team_pitching_2024.csv")
## Rows: 32 Columns: 36
## ── Column specification ────────────────────────────────────────────────────────
## Delimiter: ","
## chr (1): Tm
## dbl (35): #P, PAge, RA/G, W, L, W-L%, ERA, G, GS, GF, CG, tSho, cSho, SV, IP...
##
## ℹ Use `spec()` to retrieve the full column specification for this data.
## ℹ Specify the column types or set `show_col_types = FALSE` to quiet this message.
MLB_team_batting_2024 <- read_csv("mlb_team_batting_2024.csv")
## Rows: 32 Columns: 29
## ── Column specification ────────────────────────────────────────────────────────
## Delimiter: ","
## chr (1): Tm
## dbl (28): #Bat, BatAge, R/G, G, PA, AB, R, H, 2B, 3B, HR, RBI, SB, CS, BB, S...
##
## ℹ Use `spec()` to retrieve the full column specification for this data.
## ℹ Specify the column types or set `show_col_types = FALSE` to quiet this message.
# Individual player datasets
player_salary_2024 <- read_excel("player_salary_2024.xlsx")
individual_player_stats_offense_2024 <- read_excel("individual_player_stats_offense_2024.xlsx")
## New names:
## • `` -> `...1`
individual_pitching_stats_2024 <- read_excel("individual_pitching_stats_2024.xlsx")
MLB_team_spending_2024 |>
filter(!is.na(Rank))|>
mutate(Wins = parse_number(Record)) |>
select(-Record)|>
rename(total_payroll_allocations = "Total PayrollAllocations")|>
mutate(across(
c(total_payroll_allocations, "Active26-Man", "Injured", "Retained", "Buried"),
parse_number
))|>
ggplot(aes(x = total_payroll_allocations, y = Wins)) +
geom_point(size = 2.5, color = "Orange")+
geom_smooth(method = "lm", se = FALSE, color = "red", linewidth = 0.7, alpha = 0.2) +
scale_x_continuous(labels = scales::comma) +
labs(
x = "Total Payroll Allocations",
y = "Wins",
title = "Total Payroll Allocations vs. Wins"
) +
theme_minimal()
## Warning: There was 1 warning in `mutate()`.
## ℹ In argument: `Wins = parse_number(Record)`.
## Caused by warning:
## ! 1 parsing failure.
## row col expected actual
## 16 -- a number -
## Warning: There was 1 warning in `mutate()`.
## ℹ In argument: `across(...)`.
## Caused by warning:
## ! 1 parsing failure.
## row col expected actual
## 18 -- a number -
## `geom_smooth()` using formula = 'y ~ x'
## Warning: Removed 1 row containing non-finite outside the scale range
## (`stat_smooth()`).
## Warning: Removed 1 row containing missing values or values outside the scale range
## (`geom_point()`).
Alt-text: The graph is a scatter plot. Each dot is a separate MLB team. On the x-axis is a team’s total payroll allocations in the form of USD. The x-axis ranges from 50,000,000 to 350,000,000 dollars. On the y-axis is wins, ranging from 40 to 100. Dots are relatively scattered, but there is a regression line that brings more clarity to the relationship. The plot shows a slight positive correlation between team payroll allocations and wins, indicating that teams that spend more are generally more likely to win.
Interpretation/Explanation: This graph shows us that there is a positive relationship between team payroll and wins. As a team increases their payroll, their wins will increase as well. While it is subtle, the regression line is positive helping us answer our question of whether paying more for players leads to more wins for a team, it does.
team_payroll_pitching <- MLB_team_spending_2024 |>
filter(!is.na(Rank)) |>
mutate(
total_payroll_allocations = parse_number(`Total PayrollAllocations`),
Team = recode(Team,
ARI = "Arizona Diamondbacks",
ATL = "Atlanta Braves",
BAL = "Baltimore Orioles",
BOS = "Boston Red Sox",
CHC = "Chicago Cubs",
CHW = "Chicago White Sox",
CIN = "Cincinnati Reds",
CLE = "Cleveland Guardians",
COL = "Colorado Rockies",
DET = "Detroit Tigers",
HOU = "Houston Astros",
KC = "Kansas City Royals",
LAA = "Los Angeles Angels",
LAD = "Los Angeles Dodgers",
MIA = "Miami Marlins",
MIL = "Milwaukee Brewers",
MIN = "Minnesota Twins",
NYM = "New York Mets",
NYY = "New York Yankees",
OAK = "Oakland Athletics",
PHI = "Philadelphia Phillies",
PIT = "Pittsburgh Pirates",
SD = "San Diego Padres",
SEA = "Seattle Mariners",
SF = "San Francisco Giants",
STL = "St. Louis Cardinals",
TB = "Tampa Bay Rays",
TEX = "Texas Rangers",
TOR = "Toronto Blue Jays",
WSH = "Washington Nationals"
)
) |>
inner_join(
MLB_team_pitching_2024 |>
filter(Tm != "League Average"),
by = c("Team" = "Tm")
)
team_payroll_pitching |>
ggplot(aes(x = total_payroll_allocations, y = ERA)) +
geom_point(size = 2.5, color = "Orange") +
geom_smooth(method = "lm", se = FALSE, color = "red", linewidth = 0.7) +
scale_x_continuous(labels = scales::comma) +
labs(
x = "Total Payroll Allocations ($)",
y = "Team ERA",
title = "Total Payroll Allocations vs. Team ERA"
) +
theme_minimal()
## `geom_smooth()` using formula = 'y ~ x'
Alt Text: The graph compares total payroll allocations with team ERA for the 2024 MLB season. Each dot represents one MLB team. The x-axis shows total payroll allocations in dollars, ranging from approximately $50 million to $325 million, and the y-axis shows team ERA, ranging from approximately 3.5 to 5.5. The dots are spread out across the graph, showing that teams with higher payrolls do not necessarily have lower ERAs. The red regression line shows a slight negative relationship, suggesting that teams with higher payrolls generally had slightly lower ERAs, but the relationship is weak.
Interpretation/Explanation: This graph shows us that there is a negative relationship between team payroll and earned run average (a pitching stat where the lower the number is better, earned runs divided by innings pitched). This means that as team payroll goes up, their pitching is going to be better which will help teams win more games. The relationship is subtle meaning payroll does not have a huge impact but there is a positive impact. This shows that higher payroll does help teams win more games because a better ERA will benefit a team.