Can Twitter Sentiment/Data Predict NFL Games? Week 16 2021

I’ve been writing about how Twitter Sentiment affects NFL Games for a few weeks on Medium now. It’s been quite an interesting dataset. My initial hypothesis going into this was that teams with higher pregame Twitter sentiment would win. I was shown wrong in the first 5 games I analyzed. From weeks 12 to 15, I analyzed 5 NFL games and in all 5 the team with the lower Twitter sentiment won. These were the 5 games:

In this post, we’re going to do a mathematical/numerical analysis on the sentiments of these teams. We want to see if there is a mathematical reason that teams with lower sentiment won more often. The current ratio is 11 to 8, with lower sentiment teams winning 11 games and higher sentiment teams winning 8. 

NFL Week 16 Games

In week 16, the team with the higher sentiment won 5 games while the team with the lower sentiment won 6 games.

  1. Twitter Sentiment: Steelers at Chiefs, Week 16, 2021 — Lower sentiment team (Chiefs) win
  2. Twitter Sentiment: Broncos at Raiders, Week 16, 2021 — Lower sentiment team (Raiders) win
  3. Twitter Sentiment: Bears at Seahawks, Week 16, 2021 — Lower sentiment team (Bears) win
  4. Twitter Sentiment Analysis: Ravens at Bengals, Week 16, 2021 — Lower sentiment team (Bengals) win
  5. Twitter Sentiment Analysis: Rams at Vikings, Week 16, 2021 — Higher sentiment team (Rams) win
  6. Twitter Sentiment Analysis: Chargers at Texans, Week 16, 2021 — Lower sentiment team (Texans) win
  7. Twitter Sentiment Analysis: Buccaneers at Panthers, Week 16, 2021 — Higher sentiment team (Bucs) win
  8. Twitter Sentiment Analysis: Jaguars at Jets, Week 16, 2021 — Higher sentiment team (Jets) win
  9. Twitter Sentiment Analysis: Giants at Eagles, Week 16, 2021 — Lower sentiment team (Eagles) win
  10. Twitter Sentiment: Washington Football Team vs Cowboys, Week 16 — Higher sentiment team (Cowboys) win
  11. Twitter Sentiment: Dolphins at Saints, Week 16 | by Yujian Tang – Higher sentiment team (Dolphins) win

Twitter Sentiment Values vs Actual Outcomes

Clearly Twitter sentiment isn’t a strong enough predictor by itself to predict outcomes of games. This leads us to another question though, can it be used? Let’s take a look at the numerical analysis.

When Did Lower Twitter Sentiment Teams Win?

These are the six games in which the lower sentiment team won fro week 16

  1. Twitter Sentiment: Steelers at Chiefs, Week 16, 2021 — Lower sentiment team (Chiefs) win
  2. Twitter Sentiment: Broncos at Raiders, Week 16, 2021 — Lower sentiment team (Raiders) win
  3. Twitter Sentiment: Bears at Seahawks, Week 16, 2021 — Lower sentiment team (Bears) win
  4. Twitter Sentiment Analysis: Ravens at Bengals, Week 16, 2021 — Lower sentiment team (Bengals) win
  5. Twitter Sentiment Analysis: Chargers at Texans, Week 16, 2021 — Lower sentiment team (Texans) win
  6. Twitter Sentiment Analysis: Giants at Eagles, Week 16, 2021 — Lower sentiment team (Eagles) win

Team Record

GamePre Game Win Differential
Steelers at ChiefsChiefs Up 3 W
Broncos at RaidersSame record
Bears at SeahawksBears Down 1 W
Ravens at BengalsSame record
Chargers at TexansTexans Down 5 W
Giants at EaglesEagles Up 3 W

Average win differential for when team with lower Twitter sentiment wins: 0

Sentiment Value Difference

GameSentiment Difference
Steelers at Chiefs0.1874 vs 0.1249 → -0.0625
Broncos at Raiders0.1674 vs 0.1310 → -0.0364
Bears at Seahawks0.0378 vs 0.0699 → -0.0321
Ravens at Bengals0.1477 vs 0.1322 → -0.0155
Chargers at Texans0.0451 vs 0.0392 → -0.0059
Giants at Eagles0.1280 vs 0.0711 → -0.0569

Average sentiment difference when team with lower Twitter sentiment wins: -0.0295

Point Differentials

GamePoint differential prior to game
Steelers at Chiefs-3.1 to 6.4 → 9.5
Broncos at Raiders3.0 to -5.4 → -8.4
Bears at Seahawks-7.8 to 0.0 → -7.8
Ravens at Bengals1.4 to 4.7 → 3.3
Chargers at Texans0.6 to -11.8 → -12.4
Giants at Eagles-6.6 to 4.0 → 10.6

Average game point differential when the team with the lower Twitter sentiment won: -5.2

Interesting note: in the 6 games that teams with lower sentiment won, 5 of those were home games.

When Did Higher Twitter Sentiment Teams Win?

  1. Twitter Sentiment Analysis: Rams at Vikings, Week 16, 2021 — Higher sentiment team (Rams) win
  2. Twitter Sentiment Analysis: Buccaneers at Panthers, Week 16, 2021 — Higher sentiment team (Bucs) win
  3. Twitter Sentiment Analysis: Jaguars at Jets, Week 16, 2021 — Higher sentiment team (Jets) win
  4. Twitter Sentiment: Washington Football Team vs Cowboys, Week 16 — Higher sentiment team (Cowboys) win
  5. Twitter Sentiment: Dolphins at Saints, Week 16 | by Yujian Tang – Higher sentiment team (Dolphins) win

Team Record

GamePre game Win Differential
Rams at VikingsRams Up 3 W
Bucs at PanthersBucs Up 5 W
Jaguars at JetsJets Up 1 W
WFT at CowboysCowboys Up 4 W
Dolphins at SaintsSame

In the games where the team with the higher Twitter sentiment won, the winning team was up by an average of 2.6 wins.

Sentiment Value Difference

GameSentiment Difference
Rams at Vikings0.2115 vs 0.0636 → 0.1479
Bucs at Panthers0.1600 vs 0.0891 → 0.0709
Jaguars at Jets0.0383 vs 0.0927 → 0.0544
WFT at Cowboys0.1499 vs 0.1730 → 0.0231
Dolphins at Saints0.1877 vs 0.1435 → 0.0442

The average sentiment difference for the games where the team with the higher Twitter sentiment won in Week 16 was 0.0681.

Point Differential

GamePre game Point Differential
Rams at Vikings5.9 to 1.4 → 4.5
Bucs at Panthers7.4 to -3.0 → 10.4
Jaguars at Jets-12.4 to -12.7 → 0.3
WFT at Cowboys-4.9 to 7.7 → 12.6
Dolphins at Saints-1.9 to 2.0 → -3.9

The average point differential for higher Twitter sentiment teams that won is 4.78.

An interesting thing to note here is that away teams won 3 out of 5 times when the higher sentiment team won.

Graph of Sentiment Differential vs Higher Twitter Sentiment Wins

Here are the graphs of the Twitter Sentiment Differential, Pregame Point Differential, and Win Differentials against whether or not the team with the higher sentiment won:

From the graphs we can tell that NONE of these individual predictors are good by themselves, but will a multivariate logistic regression with principal component analysis provide a better predictor? We’ll find out next time.

Code

Here’s the code we used for the Twitter Sentiment and Pulling the Tweets

Here’s the code for the graphs:

import matplotlib.pyplot as plt
 
# sentiment difference wins and losses
# team with higher sentiment win = 1, team with higher sentiment loss = 0
# x value = sentiment difference
x = [0.0625, 0.0364, 0.0321, 0.0155, 0.0059, 0.0569, 0.1479, 0.0709, 0.0544, 0.0231, 0.0442]
y = [0,0,0,0,0,0,1,1,1,1,1]
plt.scatter(x, y)
plt.title("Twitter Sentiment Differential")
plt.xlabel("Twitter Sentiment Difference")
plt.ylabel("Win/Loss")
plt.show()
# point difference wins and losses
# x value = point differential of winning team
# y value = win/loss
x = [9.5, -8.4, -7.8, 3.3, -12.4, 10.6, 4.5, 10.4, 0.3, 12.6, -3.9]
y = [0,0,0,0,0,0,1,1,1,1,1]
plt.scatter(x, y)
plt.title("Pre-game Point Differential")
plt.xlabel("Pre-game Point Difference")
plt.ylabel("Win/Loss")
plt.show()
 
# win differential wins and losses
# x value = winning team's win difference
# y value = did higher twitter sentiment team win
x = [3, 0, -1, 0, -5, 3, 3, 5, 1, 4, 0]
plt.scatter(x, y)
plt.title("Pre-game Win Differential")
plt.xlabel("Pre-game Win Difference")
plt.ylabel("Win/Loss")
plt.show()

Summary

What did we learn? It’s hard to predict NFL games.

Learn More

To learn more, feel free to reach out to me @yujian_tang on Twitter, connect with me on LinkedIn, and join our Discord. Remember to follow the blog to stay updated with cool Python projects and ways to level up your Software and Python skills! If you liked this article, please Tweet it, share it on LinkedIn, or tell your friends!

I run this site to help you and others like you find cool projects and practice software skills. If this is helpful for you and you enjoy your ad free site, please help fund this site by donating below! If you can’t donate right now, please think of us next time.

Yujian Tang
Yujian Tang

I started my professional software career interning for IBM in high school after winning ACSL two years in a row. I got into AI/ML in college where I published a first author paper to IEEE Big Data. After college I worked on the AutoML infrastructure at Amazon before leaving to work in startups. I believe I create the highest quality software content so that’s what I’m doing now. Drop a comment to let me know!

One-Time
Monthly
Yearly

Make a one-time donation

Make a monthly donation

Make a yearly donation

Choose an amount

$5.00
$15.00
$100.00
$5.00
$15.00
$100.00
$5.00
$15.00
$100.00

Or enter a custom amount

$

Your contribution is appreciated.

Your contribution is appreciated.

Your contribution is appreciated.

DonateDonate monthlyDonate yearly

One thought on “Can Twitter Sentiment/Data Predict NFL Games? Week 16 2021

Leave a Reply

%d bloggers like this: