NYC Data Science Academy| Blog
Bootcamps
Lifetime Job Support Available Financing Available
Bootcamps
Data Science with Machine Learning Flagship ๐Ÿ† Data Analytics Bootcamp Artificial Intelligence Bootcamp New Release ๐ŸŽ‰
Free Lesson
Intro to Data Science New Release ๐ŸŽ‰
Find Inspiration
Find Alumni with Similar Background
Job Outlook
Occupational Outlook Graduate Outcomes Must See ๐Ÿ”ฅ
Alumni
Success Stories Testimonials Alumni Directory Alumni Exclusive Study Program
Courses
View Bundled Courses
Financing Available
Bootcamp Prep Popular ๐Ÿ”ฅ Data Science Mastery Data Science Launchpad with Python View AI Courses Generative AI for Everyone New ๐ŸŽ‰ Generative AI for Finance New ๐ŸŽ‰ Generative AI for Marketing New ๐ŸŽ‰
Bundle Up
Learn More and Save More
Combination of data science courses.
View Data Science Courses
Beginner
Introductory Python
Intermediate
Data Science Python: Data Analysis and Visualization Popular ๐Ÿ”ฅ Data Science R: Data Analysis and Visualization
Advanced
Data Science Python: Machine Learning Popular ๐Ÿ”ฅ Data Science R: Machine Learning Designing and Implementing Production MLOps New ๐ŸŽ‰ Natural Language Processing for Production (NLP) New ๐ŸŽ‰
Find Inspiration
Get Course Recommendation Must Try ๐Ÿ’Ž An Ultimate Guide to Become a Data Scientist
For Companies
For Companies
Corporate Offerings Hiring Partners Candidate Portfolio Hire Our Graduates
Students Work
Students Work
All Posts Capstone Data Visualization Machine Learning Python Projects R Projects
Tutorials
About
About
About Us Accreditation Contact Us Join Us FAQ Webinars Subscription An Ultimate Guide to
Become a Data Scientist
    Login
NYC Data Science Acedemy
Bootcamps
Courses
Students Work
About
Bootcamps
Bootcamps
Data Science with Machine Learning Flagship
Data Analytics Bootcamp
Artificial Intelligence Bootcamp New Release ๐ŸŽ‰
Free Lessons
Intro to Data Science New Release ๐ŸŽ‰
Find Inspiration
Find Alumni with Similar Background
Job Outlook
Occupational Outlook
Graduate Outcomes Must See ๐Ÿ”ฅ
Alumni
Success Stories
Testimonials
Alumni Directory
Alumni Exclusive Study Program
Courses
Bundles
financing available
View All Bundles
Bootcamp Prep
Data Science Mastery
Data Science Launchpad with Python NEW!
View AI Courses
Generative AI for Everyone
Generative AI for Finance
Generative AI for Marketing
View Data Science Courses
View All Professional Development Courses
Beginner
Introductory Python
Intermediate
Python: Data Analysis and Visualization
R: Data Analysis and Visualization
Advanced
Python: Machine Learning
R: Machine Learning
Designing and Implementing Production MLOps
Natural Language Processing for Production (NLP)
For Companies
Corporate Offerings
Hiring Partners
Candidate Portfolio
Hire Our Graduates
Students Work
All Posts
Capstone
Data Visualization
Machine Learning
Python Projects
R Projects
About
Accreditation
About Us
Contact Us
Join Us
FAQ
Webinars
Subscription
An Ultimate Guide to Become a Data Scientist
Tutorials
Data Analytics
  • Learn Pandas
  • Learn NumPy
  • Learn SciPy
  • Learn Matplotlib
Machine Learning
  • Boosting
  • Random Forest
  • Linear Regression
  • Decision Tree
  • PCA
Interview by Companies
  • JPMC
  • Google
  • Facebook
Artificial Intelligence
  • Learn Generative AI
  • Learn ChatGPT-3.5
  • Learn ChatGPT-4
  • Learn Google Bard
Coding
  • Learn Python
  • Learn SQL
  • Learn MySQL
  • Learn NoSQL
  • Learn PySpark
  • Learn PyTorch
Interview Questions
  • Python Hard
  • R Easy
  • R Hard
  • SQL Easy
  • SQL Hard
  • Python Easy
Data Science Blog > Data Visualization > Using Data to Analyze Clutch Batting in MLB

Using Data to Analyze Clutch Batting in MLB

Hao-Wei
Posted on Nov 5, 2021

Data Science Introduction

Data shows that MLB, the major league of baseball, is one of the largest sports leagues in the United States. According to the estimation of Sportico, the average value of the thirty MLB franchises reached about 2.2 billion in 2021. As the baseball players are one of the most critical assets of the teams, it is therefore important for the teams and interesting for the fans to assess the skills of baseball athletes.

More importantly, the success story of Oakland Athleticsโ€™ โ€œMoneyballโ€ season in 2002 has stimulated the entire baseball society to develop a data-driven approach to better evaluate the baseball playerโ€™s skill from the statistics.

 

Despite the extended history of research in baseball statistics, clutch pitching and batting remained mysterious. Roughly speaking, we say a batting situation is a clutch situation if the batter is in a situation when he could change the game in a swing. We are in particular interested in the following question: Is there an indicator, or a combination of indicators that can help us identify good clutch batters?

 

Looking back to the literature, it seemed that the answer to the question had been controversial. Many statisticians, believed that the clutch batting ability is inexistent or negligible. For example, Cramer stated that there is virtually no evidence of clutch hitting ([Cramer 1977]); while Silver believed that clutch hitting exists, but the difference should be insignificant [Silver 2006]. On the other hand, many baseball players do believe that there is a conceivable difference between good and bad clutch hitters when the game is in the line (see ).

 

Our goal of the project is to look into the data and try to give our answers to the following questions:

  • Does clutch hitting ability statistically exist?
  • What are the factors related to clutch hitting ability?
  • Are there a certain group of players better at clutch hitting?

 

Data Acquisition

The first step of the project is to collect the baseball data. Although baseball statistics nowadays have become more comprehensive than in the past. Since the planned scope of the project is the players throughout the MLB history, we will scrape the batting data from Retrosheet. Writing a Python script using the BeautifulSoup library, we got a database of 19917 MLB players. After ignoring those who have never played as a batter, we scraped 16009 players and got 84231 batting seasons among these players.

 

A very handy feature for the data collected from Retrosheet is that they parsed through the entire log of every game, and collected the batting statistics for four clutch situations:

  • Where there is a runner on the base
  • Where there is a runner in scoring position (second or third base)
  • When the game is โ€œlate and closeโ€
  • When all the three bases are loaded with runners

In each situation, we will look at the following three batting statistics of each player, and compare them with the corresponding overall statistics:

  • AVG, the batting average, which indicates the percentage a batter makes a hit,
  • OBP, the on-base percentage, which indicates the percentage a batter makes it to at least the first base, and
  • SLG, the slugging percentage, which takes into account the percentage a player makes an extra-base hit.

 

Does clutch batting exist? Introducing the p-value scores 

Now, as we get the data, it is time for us to find a way to evaluate โ€œclutch battingโ€. The essence of the question is that we need to figure out metrics that address the following challenges:

  • Be able to statistically distinguish whether the clutch batting ability is completely determined by luck.
  • Reflect on the fact that every batter has a different batting ability.

 

Our first approach is to introduce a p-value for each combination of statistics and situation. To give a concrete example, let us look at the career AVG overall and career AVG in the โ€œrunner in scoring positionโ€ (or RISP) situation for two Hall-of-Famer players:

Name AVG AVG_RISP
Ivan Rodrigues .293 .290
Hank Aaron .296 .326

Table 1: The total AVG and the AVG in RISP situation for two baseball players

 

Since Hank Aaron had a slightly higher batting average, we need to take that into account when evaluating their clutch batting ability. Taking that into consideration, we can apply the statistics and compute a p-value, which gives a rectified score for his batting average in the RISP situation.

 

The intuitive meaning of the p-value score for Hank Aaron is as follows: Assumption that the chance of Hank making a hit is .296, and is invariant in every situation (just image that Hank is throwing a coin with a probability of 29.6% every time he is at bat). What is the probability that his batting average in RISP is .326 or less?

 

Using Fisherโ€™s exact test implemented in Scipy, we can get the p-value score, which is a score between 0 (when the batting average in RISP is extremely low) and 1 (when the batting average in RISP is extremely high). Suppose that we are in a world where there is no clutch batting ability at all, then the p-value score will be uniformly distributed between 0 and 1 in theory. So, we can gain some insight on whether clutch batting ability exists by checking whether this is the case.

 

To visualize the distribution of the p-value score, we can draw a cumulative graph so that the y-axis is the p-value, and the x-axis is the number of players. In the case the hypothesis that clutch batting ability does not exist is true (which means that batting in a clutch situation depends solely on luck), the cumulative graph will be a straight line.

The red lines in the able 2 illustrate the p-value scores of the AVG for all eligible players in the four clutch situations. Alternatively, we can also check whether the distribution is uniform by the Kolmogorov-Smirov test. Using the functions in Scipy, we can get the p-value of the test, and conventionally we will reject that the distribution is uniform if the p-value is less than 0.05.

 

Runners on scoring position Men on bases
pKS=0.1356 pKS=6.97e-12

 

Close and late Bases loaded
pKS=0.0012 pKS=0.5413

Table 2: The cumulative graphs, the histograms of the rectified p-value scores, and the Kolmogorov-Smirov p-values (pKS) of the rectified p-value scores of the AVG for all eligible players in various clutch situations. In the cumulated graphs, the y-axes are the p-value scores, and the x-axes are the number of eligible players. The red lines are the original p-value scores, and the blue lines are the rectified p-value scores.

 

Looking at the cumulative graphs, this p-value scores approach did not go well: they are biased either toward 0 or 1. This means that in all the clutch situations, the batting averages are biased: sometimes to the higher end, and sometimes to the lower end. We are not able to specify reasons for these phenomena, but some possible explanations may be that in late and close situations, batters will face the elite setup-men or closers, and making hits will be harder; and weaker pitchers have a higher chance of facing RISP situations than stronger ones, so batters have an easier time facing these in average.

 

Therefore, aiming to annihilate such kind of discrepancy, before computing the p-value score, we adjusted the clutch batting statistics by a weighted linear regression. The cumulated graph of the adjusted p-value scores is shown in blue in Table 1. In Table 1, we plotted the histogram of the adjusted p-values and the adjusted Kolmogorov-Smirov p-values.

It is evident that after the adjustment, the distribution of the p-values is much closer to the uniform distribution. And the Kolmogorov-Smirov p-values even suggest that in some of the clutch situations, the clutch batting average is even statistically indistinguishable from battering completely by luck!

 

In conclusion, it turned out that after the bias removal, clutch batting ability seemed to be non-existent in some cases. For the other cases, since the p-values are still biased to both extremes in some cases, and the Kolmogorov-Smirov test suggested that the distribution is not uniform in some cases, we suspect that the clutch batting ability still exists, but not to a really large extent. We will dive deeper into these p-value scores in various statistics and situations to search for more fun facts which might relate to clutch batting ability under our settings.

 

Searching for factors affecting clutch batting ability

So far, for each statistic (AVG, OPS, and SLG) and each clutch situation, we can compute the p-value score for each batter, giving us 12 scores. A natural question is: are those scores consistent? It turned out to be trickier than we thought. Letโ€™s look at the example between the AVG of Ivan Rodriguez and Hank Aaron again in Table 3:

 

AVG AVG)RISP p_RISP p_Men_on_base p_Close_&_late p_Bases_loaded
Ivan Rodriguez .293 .290 .139 .271 .266 .520
Hank Aaron .296 .326 .994 .767 .997 .485

Table 3: The AVG and p-value scores of two Hall-of-Famer players in various situations

 

According to our metric, it seems that although Hank Aaron has a much higher p-value score in the RISP situation, it is not consistent in other clutch situations. It suggests we compute the correlation among all the p-score values from all the situations and batting statistics. 

 

Table 4: The correlation matrix of p-value scores over various situations and statistics

 

We observed some facts from the correlation matrix in Table 4. On one hand, it is less surprising that there is a high correlation on the p-value scores on different statistics (AVG, OBP, and SLG) over the same situation, as shown in the diagonal blocks separated by the blue lines; on the other hand, it is surprising that the correlation is in general low (within plus-minus 0.3) over different clutch situations, even though those clutch situations more or less overlap.

The low correlation of p-value scores over different clutch situations seemed to suggest that the batting statistics, AVG, OLB, SLG, might reflect more luck than the true โ€œclutch batting abilityโ€.

 

Letโ€™s still assume that the p-value scores still reflect clutch batting ability to some extent. A natural question is, is there any other batting ability or characteristics related to the p-value scores? To inspect this question, let us look at some other batting statistics which have been extensively used to evaluate a player:

  • AB/HR: At bats per home run
  • BABIP: Batting average on balls in play
  • BB/PA: The frequency to get a walk
  • BB/K: Number of walks per strikeouts
  • HR/H: Home runs per hit
  • ISO: Isolated power: a hitter's ability to hit for extra bases
  • PA/SO: Plate appearances per strikeout
  • OPS: On-base average plus slugging average

 

Some of them can be directly picked up from Retrosheets, and the others can be derived from basic statistics. We can then add the plethora of these statistics with the p-values and get a large correlation matrix, as shown in Table 5:

 

Table 5: The correlation matrix of p-value scores over various situations and statistics, together with other batting statistics

 

From Table 5, we can see that most of the batting statistics have a low correlation with the p-value scores (within plus-minus 0.3) and low statistical significance. Assuming that one is willing to aggressively take low correlation (around plus-minus 0.2) as causality and believe that the clutch batting ability lies in the p-value scores, one can make the following hypotheses:

  • Since AB/HR has a positive correlation, and HR/H and ISO have a negative correlation with the p-value scores, players who make more longer hits tends to be worse in the clutch; and
  • Since BB/K and PA/SO have positive correlations with the p-value scores, players who walk more and get struck out less often tend to be better clutch players.

 

The hypotheses are consistent with Silverโ€™s assertions on sluggers and home plate discipline in [Silver 2006].

 

Comparing among groups

We are also interested in whether the backgrounds of baseball players affect their mentality or clutch batting ability. Again, assuming that the p-value scores reflects the clutch batting ability to some extent, we can make some comparison.

 

Left-handed versus right-handed: First, we can compare the batting position. Figure 6 is a violin plot that gives the comparison among the distribution of p-value scores over left-handed, right-handed, and switch hitters. It turned out that the p-value scores for the left- and right-handed batters are rather uniformly distributed from 0 to 1. On the other hand, although the p-value scores of switch hitters are somewhat distributed to the lower end, we will reserve our conclusion since the sample size is much smaller.

 

Figure 6: The frequency distribution of the p-value scores over left-handed, right-handed, and switch hitters

 

Domestic versus international players: Figure 7 gives a comparison among the distribution of p-value scores over players from the United States and players from other countries. It seems that there is no significant difference between the clutch batting ability.

Figure 7: The frequency distribution of the p-value scores over domestic and international players

 

Are Hall-of-Famers better in clutch situations? Figure 8 gives a comparison between the distribution of p-value scores over Hall-of-Famer batters over other players. It seems that there is no significant difference between the clutch batting ability. It seems that the p-value scores of Hall-of-Famers are leaning toward the higher end, which probably indicates that Hall-of-Famers are better clutch players on average.

 

Figure 8: The frequency distribution of the p-value scores over Hall-of-Fame batters and other players

 

Conclusion and further directions

Using the traditional batting statistics of MLB baseball players over various clutch situations, we developed a scoring metric, the p-value scores, to evaluate the outcomes of a baseball player in clutch situations, adjusted by their batting ability. We analyzed these metrics and found that the clutch batting ability might have at most a slight relation with the actual outcomes. Finally, we analyzed the relation of the p-value scores with other batting statistics and the relation of the p-value scores with players with different backgrounds.

 

Listed below are some aspects that I am as well interested, but did not have time to address:

  • Find a better model than weighted linear regression to adjust the p-value scores.
  • Investigate the relation between p-value scores and different periods in the season.
  • Take into account the effect of different stadiums and years.
  • MLB improved their equipment and made more advanced metrics, Statcast since 2015. Find if there is a metric that better indicates clutch batting ability.

 

Reference

[Cramer 1977] R. Cramer, "Do Clutch Hitters Exist?", SABR Baseball Research Journal (1977)

[Silver 2006] N. Silver, "Is David Ortiz a Clutch Hitter?", in Jonah Keri, Ed., Baseball Between the Numbers (New York: Basic Books, 2006): 14โ€“35.

[Verducci 2004], T. Verducci, "Does Clutch Hitting Truly Exist?", Sports Illustrated, April 5, 2004: 60โ€“62.

The skills I demoed here can be learned through taking Data Science with Machine Learning bootcamp with NYC Data Science Academy.

About Author

Hao-Wei

Hao-Wei is an NYC Data Science Acadamy Fellow with master's degrees in Communication Engineering and Mathematics from National Taiwan University, and a Ph. D. degree in Mathematics from the Pennsylvania State University. With a broad experience ranging from...
View all posts by Hao-Wei >

Leave a Comment

No comments found.

View Posts by Categories

All Posts 2399 posts
AI 7 posts
AI Agent 2 posts
AI-based hotel recommendation 1 posts
AIForGood 1 posts
Alumni 60 posts
Animated Maps 1 posts
APIs 41 posts
Artificial Intelligence 2 posts
Artificial Intelligence 2 posts
AWS 13 posts
Banking 1 posts
Big Data 50 posts
Branch Analysis 1 posts
Capstone 206 posts
Career Education 7 posts
CLIP 1 posts
Community 72 posts
Congestion Zone 1 posts
Content Recommendation 1 posts
Cosine SImilarity 1 posts
Data Analysis 5 posts
Data Engineering 1 posts
Data Engineering 3 posts
Data Science 7 posts
Data Science News and Sharing 73 posts
Data Visualization 324 posts
Events 5 posts
Featured 37 posts
Function calling 1 posts
FutureTech 1 posts
Generative AI 5 posts
Hadoop 13 posts
Image Classification 1 posts
Innovation 2 posts
Kmeans Cluster 1 posts
LLM 6 posts
Machine Learning 364 posts
Marketing 1 posts
Meetup 144 posts
MLOPs 1 posts
Model Deployment 1 posts
Nagamas69 1 posts
NLP 1 posts
OpenAI 5 posts
OpenNYC Data 1 posts
pySpark 1 posts
Python 16 posts
Python 458 posts
Python data analysis 4 posts
Python Shiny 2 posts
R 404 posts
R Data Analysis 1 posts
R Shiny 560 posts
R Visualization 445 posts
RAG 1 posts
RoBERTa 1 posts
semantic rearch 2 posts
Spark 17 posts
SQL 1 posts
Streamlit 2 posts
Student Works 1687 posts
Tableau 12 posts
TensorFlow 3 posts
Traffic 1 posts
User Preference Modeling 1 posts
Vector database 2 posts
Web Scraping 483 posts
wukong138 1 posts

Our Recent Popular Posts

AI 4 AI: ChatGPT Unifies My Blog Posts
by Vinod Chugani
Dec 18, 2022
Meet Your Machine Learning Mentors: Kyle Gallatin
by Vivian Zhang
Nov 4, 2020
NICU Admissions and CCHD: Predicting Based on Data Analysis
by Paul Lee, Aron Berke, Bee Kim, Bettina Meier and Ira Villar
Jan 7, 2020

View Posts by Tags

#python #trainwithnycdsa 2019 2020 Revenue 3-points agriculture air quality airbnb airline alcohol Alex Baransky algorithm alumni Alumni Interview Alumni Reviews Alumni Spotlight alumni story Alumnus ames dataset ames housing dataset apartment rent API Application artist aws bank loans beautiful soup Best Bootcamp Best Data Science 2019 Best Data Science Bootcamp Best Data Science Bootcamp 2020 Best Ranked Big Data Book Launch Book-Signing bootcamp Bootcamp Alumni Bootcamp Prep boston safety Bundles cake recipe California Cancer Research capstone car price Career Career Day ChatGPT citibike classic cars classpass clustering Coding Course Demo Course Report covid 19 credit credit card crime frequency crops D3.js data data analysis Data Analyst data analytics data for tripadvisor reviews data science Data Science Academy Data Science Bootcamp Data science jobs Data Science Reviews Data Scientist Data Scientist Jobs data visualization database Deep Learning Demo Day Discount disney dplyr drug data e-commerce economy employee employee burnout employer networking environment feature engineering Finance Financial Data Science fitness studio Flask flight delay football gbm Get Hired ggplot2 googleVis H20 Hadoop hallmark holiday movie happiness healthcare frauds higgs boson Hiring hiring partner events Hiring Partners hotels housing housing data housing predictions housing price hy-vee Income industry Industry Experts Injuries Instructor Blog Instructor Interview insurance italki Job Job Placement Jobs Jon Krohn JP Morgan Chase Kaggle Kickstarter las vegas airport lasso regression Lead Data Scienctist Lead Data Scientist leaflet league linear regression Logistic Regression machine learning Maps market matplotlib Medical Research Meet the team meetup methal health miami beach movie music Napoli NBA netflix Networking neural network Neural networks New Courses NHL nlp NYC NYC Data Science nyc data science academy NYC Open Data nyc property NYCDSA NYCDSA Alumni Online Online Bootcamp Online Training Open Data painter pandas Part-time performance phoenix pollutants Portfolio Development precision measurement prediction Prework Programming public safety PwC python Python Data Analysis python machine learning python scrapy python web scraping python webscraping Python Workshop R R Data Analysis R language R Programming R Shiny r studio R Visualization R Workshop R-bloggers random forest Ranking recommendation recommendation system regression Remote remote data science bootcamp Scrapy scrapy visualization seaborn seafood type Selenium sentiment analysis sentiment classification Shiny Shiny Dashboard Spark Special Special Summer Sports statistics streaming Student Interview Student Showcase SVM Switchup Tableau teachers team team performance TensorFlow Testimonial tf-idf Top Data Science Bootcamp Top manufacturing companies Transfers tweets twitter videos visualization wallstreet wallstreetbets web scraping Weekend Course What to expect whiskey whiskeyadvocate wildfire word cloud word2vec XGBoost yelp youtube trending ZORI

NYC Data Science Academy

NYC Data Science Academy teaches data science, trains companies and their employees to better profit from data, excels at big data project consulting, and connects trained Data Scientists to our industry.

NYC Data Science Academy is licensed by New York State Education Department.

Get detailed curriculum information about our
amazing bootcamp!

Please enter a valid email address
Sign up completed. Thank you!

Offerings

  • HOME
  • DATA SCIENCE BOOTCAMP
  • ONLINE DATA SCIENCE BOOTCAMP
  • Professional Development Courses
  • CORPORATE OFFERINGS
  • HIRING PARTNERS
  • About

  • About Us
  • Alumni
  • Blog
  • FAQ
  • Contact Us
  • Refund Policy
  • Join Us
  • SOCIAL MEDIA

    ยฉ 2025 NYC Data Science Academy
    All rights reserved. | Site Map
    Privacy Policy | Terms of Service
    Bootcamp Application