Basketball Salaries looking at statistical trends

NBA Salaries Analysis

  • This project was done with R.

  • The goal was to try to find out which statistics contributed most to player salary.

  • Useful in classifying a range of salaries in contract negotiations for teams and agents.

  • Libraries

    • library(dplyr)
    • library(ggplot2)
    • library(ggrepel)
    • library(directlabels)
    • library(gridExtra)
    • library(tidyr)
    • library(stringr)
    • library(data.table)
    • library(rvest)
    • library(beepr)
  • Salaries and information was webscrapped from various sources.

  • Data was collected for the 1999/2000 to 2017/2018 NBA seasons

Sample Web Scrapping Code for Salaries

salary_2019 <- read_html("https://hoopshype.com/salaries/players/") %>%
  html_nodes("table") %>%  html_table

options(max.print=1000000)

# salary_2000_2018 <- lapply(paste0("https://hoopshype.com/salaries/players/", 2000-2001:2017-2018),
#                            function(url){
#                              url %>% read_html() %>%
#                                html_nodes("table") %>%  html_table
#                            })
salary_2018 <- read_html("https://hoopshype.com/salaries/players/2017-2018/") %>%
  html_nodes("table") %>%  html_table

salary_2017 <- read_html("https://hoopshype.com/salaries/players/2016-2017/") %>%
  html_nodes("table") %>%  html_table

salary_2016 <- read_html("https://hoopshype.com/salaries/players/2015-2016/") %>%
  html_nodes("table") %>%  html_table

beep("mario")
  • Below is the slide deck

nba, r

nba, r

nba, r

nba, r

nba, r

nba, r

nba, r

nba, r

nba, r

nba, r

nba, r

nba, r

nba, r

nba, r

nba, r

nba, r

nba, r

nba, r

nba, r

nba, r

nba, r

nba, r

nba, r

nba, r

nba, r

nba, r

nba, r

nba, r

nba, r

nba, r

nba, r

Full NBA salaries report

Link to Github

GAN

data science

data wrangling

neural network

nlp