Skip to content

Analysis of NBA players from 2002 to 2018 season

Notifications You must be signed in to change notification settings

kfoofw/nba_espn

Repository files navigation

nba_espn

Analysis of NBA players from 2001/02 to 2018/19 seasons

This is my personal project on learning and applying Bayesian Statistics on NBA players data. The analysis is based on learnings from John Kruschke's book "Doing Bayesian Data Analysis (2nd Edition)".

Data

The data is from ESPN's NBA players stats data for different regular seasons. An example of the 2018/19 player stats can be found in the following url:

https://www.espn.com/nba/stats/player/_/season/2019/seasontype/2

Using the Selenium package with Firefox driver, the data was scraped for the regular seasons from 2001/02 to 2018/19. The scraped data can be found in this folder.

Motivations

NBA teams have seen a shift in their playstyles for many years. In the past, teams were built around the conventional hierarchy of backcourt guards and front court roles. However the current age of NBA places a premium on 3 point shooting, and also focus on the concept of "small-ball" line-ups. The stereotypical center with dominant post-moves is now a thing of the past; teams demand "big men" with either 3 point shooting abilities or excellent passing skills.

On that premise, my motivations for this project is to explore the differences in the player statistics across the years.

Based on the ESPN data, each player is assigned their positions based on conventional basketball positions:

  • PG: Point Guard
  • SG: Shooting Guard
  • G: Guard (probably for players who can play both PG and SG)
  • SF: Small Forward
  • PF: Power Forward
  • F: Forward (probably for players who can play both SF and PF)
  • C: Center

This aspect of position labelling is the crux for the Bayesian Hierarchical (BH) modelling analysis with the basketball position integrated into the hierarchy. For this project, I will explore the following issues:

Software

I used Python with Selenium (Firefox) for webscraping. The scraping scripts can be found here in this folder.

Analysis was done using R with the RJAGS package. The analysis scripts for generating the Markov Chain Monte Carlo simulations were adopted/modified from the software that came with the "Doing Bayesian Data Analysis" book.

  • It is highly recommended to use the book as a guide for understanding RJAGs syntax.

About

Analysis of NBA players from 2002 to 2018 season

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published