What Impacts NBA Player Salaries?
Regression Analysis to Understand the Factors Impacting Player Salaries
Collect and pre-process data for NBA regression analysis
What data are we exploring?
I am interested in sports analytics, and my favorite sport is basketball, so I used player performance stats from the last 5 NBA seasons. I wrote custom functions that leverage player names and IDs to pull stats from the NBA_API. After executing the functions and merging the returned data frames, we have a dataset that contains 476 rows and 21 columns. The columns represent standard NBA performance metrics such as:
- total points
- total steals
- total assists
- etc.
This article will walk through data collection, pre-processing, and regression analysis to determine what factors impact contract values.
1. Import libraries required for collecting and pre-processing
Below is a list of libraries used to collect and manipulate the data.
from data_collection import * #custom created functions
import numpy as np
import pandas as pd
import sys
import warnings
pd.set_option('display.max_columns', None)…