Overview: The Raptor rating which is updated daily, use play-by-play and player-tracking data to calculate each player’s individual plus-minus measurements and wins above replacement, which accounts for playing time. It is a target for who is the best player in NBA. RAPTOR Rating represents “Robust Algorithm using Player Tracking and On-off Ratings”, a measure of the number of points per 100 possessions that a player contributed to his team, relative to an average NBA player.
Load the dplyr packages
library(dplyr)
Read data from CSV and store on Dataframe ps
theUrl <- "https://projects.fivethirtyeight.com/nba-model/2020/latest_RAPTOR_by_team.csv"
ps <- read.table(file=theUrl, header=TRUE, sep=",", quote = "")
Create subset ps1000 from ps for minutes played more than and equal to 1009 minutes. Two columns “poss” and “mp” are also renamed to “possessions_play” and “minutes_play”. The dataframe ps1000 is also previewed.
ps1000 <- subset(ps, mp >= 1000)
ps1000 <- ps1000 %>% rename(possessions_play = poss, minutes_play = mp)
head(ps1000)
## player_name player_id season season_type team
## 1 Steven Adams adamsst01 2020 RS OKC
## 2 Bam Adebayo adebaba01 2020 RS MIA
## 3 LaMarcus Aldridge aldrila01 2020 RS SAS
## 6 Jarrett Allen allenja01 2020 RS BRK
## 12 Giannis Antetokounmpo antetgi01 2020 RS MIL
## 15 Carmelo Anthony anthoca01 2020 RS POR
## possessions_play minutes_play raptor_box_offense raptor_box_defense
## 1 2453 1173 0.9750511 0.7881773
## 2 3393 1659 -1.0475384 1.9289819
## 3 3036 1453 -0.4360998 0.6651778
## 6 2781 1309 -1.1168753 3.3127234
## 12 3091 1381 6.3882839 2.5692329
## 15 2302 1105 -2.0543756 -2.9984414
## raptor_box_total raptor_onoff_offense raptor_onoff_defense
## 1 1.7632284 1.4475416 1.084742
## 2 0.8814435 3.5122982 1.980136
## 3 0.2290780 -2.4766351 -2.586717
## 6 2.1958481 4.1806829 -1.202160
## 12 8.9575168 0.5668167 4.720104
## 15 -5.0528170 1.7262352 -3.408669
## raptor_onoff_total raptor_offense raptor_defense raptor_total war_total
## 1 2.532284 1.1228396 0.9016316 2.0244712 2.838115
## 2 5.492434 -0.1961366 2.0264338 1.8302971 3.843649
## 3 -5.063352 -0.9265656 0.0629111 -0.8636545 1.382744
## 6 2.978523 -0.0632607 2.5657198 2.5024591 3.481315
## 12 5.286921 5.4202883 3.0955986 8.5158868 8.106010
## 15 -1.682434 -1.4302178 -3.2333162 -4.6635340 -1.067171
## war_reg_season war_playoffs predator_offense predator_defense
## 1 2.838115 0 0.4122846 1.1896102
## 2 3.843649 0 -0.2791176 1.2010579
## 3 1.382744 0 -1.0336386 0.4726307
## 6 3.481315 0 -0.6062207 2.2955669
## 12 8.106010 0 5.2170606 2.4691176
## 15 -1.067171 0 -0.6913059 -2.6752860
## predator_total pace_impact
## 1 1.6018948 -0.6869878
## 2 0.9219403 -0.8742268
## 3 -0.5610079 -1.1414423
## 6 1.6893462 -0.7722892
## 12 7.6861782 2.1625039
## 15 -3.3665918 -1.0995310
The next step can be some graphical and statistical analysis on the data. The goal for this exercise on the dataset is to find out who are the best players in NBA in 2019-2020 seasons according to the “Raptor measurements”. As I am a fan of Fantasy Basketball of Yahoo, the data gives me some insights on player’s performance.