Article: The Complete History of the NBA (https://projects.fivethirtyeight.com/complete-history-of-the-nba/#warriors)
This is a dataset that contains the elo rating of each NBA team at the end of the 2015 season. The elo rating is dependent on whether each team wins or loses, home court advantage, and the margin of each win or loss. The elo rating accounts for every game recorded since the start of the team’s franchise dating back to 1946. It can be used to predict the outcome of games as the team with the higher rating is generally favored.
nba_elo <- read.csv(url("https://raw.githubusercontent.com/fivethirtyeight/data/master/nba-elo/nbaallelo.csv"))
head(nba_elo)
## gameorder game_id lg_id X_iscopy year_id date_game seasongame
## 1 1 194611010TRH NBA 0 1947 11/1/1946 1
## 2 1 194611010TRH NBA 1 1947 11/1/1946 1
## 3 2 194611020CHS NBA 0 1947 11/2/1946 1
## 4 2 194611020CHS NBA 1 1947 11/2/1946 2
## 5 3 194611020DTF NBA 0 1947 11/2/1946 1
## 6 3 194611020DTF NBA 1 1947 11/2/1946 1
## is_playoffs team_id fran_id pts elo_i elo_n win_equiv opp_id opp_fran
## 1 0 TRH Huskies 66 1300.000 1293.277 40.29483 NYK Knicks
## 2 0 NYK Knicks 68 1300.000 1306.723 41.70517 TRH Huskies
## 3 0 CHS Stags 63 1300.000 1309.652 42.01226 NYK Knicks
## 4 0 NYK Knicks 47 1306.723 1297.071 40.69278 CHS Stags
## 5 0 DTF Falcons 33 1300.000 1279.619 38.86405 WSC Capitols
## 6 0 WSC Capitols 50 1300.000 1320.381 43.13595 DTF Falcons
## opp_pts opp_elo_i opp_elo_n game_location game_result forecast notes
## 1 68 1300.000 1306.723 H L 0.6400650
## 2 66 1300.000 1293.277 A W 0.3599350
## 3 47 1306.723 1297.071 H W 0.6311012
## 4 63 1300.000 1309.652 A L 0.3688987
## 5 50 1300.000 1320.381 H L 0.6400650
## 6 33 1300.000 1279.619 A W 0.3599350
This subset contains the elo rating of each team at the end of the regular season sorted by elo rating.
most_recent_elo <- nba_elo %>%
filter(year_id >= "2015",seasongame == 82) %>%
mutate(elo = round(elo_n)) %>%
select(year_id,team_id,elo) %>%
arrange(desc(elo))
head(most_recent_elo)
## year_id team_id elo
## 1 2015 GSW 1772
## 2 2015 SAS 1733
## 3 2015 LAC 1705
## 4 2015 HOU 1639
## 5 2015 CLE 1631
## 6 2015 ATL 1594
This bar chart shows the elo rating of all the teams. The Golden State Warriors (GSW) ended the 2015 regular season with the highest elo rating.
finals <- nba_elo %>%
filter(gameorder == max(gameorder)) %>%
mutate(elo = round(elo_n)) %>%
select(year_id,team_id,elo, game_result) %>%
arrange(desc(elo))
head(finals)
## year_id team_id elo game_result
## 1 2015 GSW 1822 W
## 2 2015 CLE 1692 L
With the highest elo rating at the end of the regular season, GSW ended the playoffs with the highest elo rating overall. Subsequently, ending the season with a win over the Cavaliers and picking up the NBA championship. Based on the elo rating at the end of the regular season, it can be implied that the team with the highest rating is the best team and are favorites to win the championship.
Ideally, I would like to implement this elo rating on more recent data. The article discussed how the 90s bulls, the 70s lakers, and the warriors had the highest rating before capturing the championsip later that year. If I was better with R, I would like to see how often the team with the highest elo rating at the end of the regular season went on to win the champsionship that year.
tail(most_recent_elo)
## year_id team_id elo
## 25 2015 CHO 1401
## 26 2015 ORL 1312
## 27 2015 LAL 1283
## 28 2015 PHI 1276
## 29 2015 MIN 1264
## 30 2015 NYK 1256
PS: the Knicks suck