Assignment 7 Scraping Ethically
NBA Standings
The question I intend to answer is which NBA teams have the best win-loss record in the 2024-25 season. Since the NBA playoffs are currently underway, I want to see which teams performed the best throughout the season. With this data, I will be able to see the best teams and make a prediction on who is going to take home the title.
I will also be comparing the conferences (East vs West) of the NBA. I have always been curious to see which conference overall is typically better rather than which conference the winner comes from. With this data, the same being used to answer both questions, I will be able to determine which conference was “better” this season.
Steps to Find the Answer
Based on the question above, I will need to scrape data from a reputable website that tracked every win and loss for each team throughout the season. I have chosen to use Basketball Reference (link listed below) as my site since they have all the records already in a table format.
I will use a web scraping tool, RVEST, to extract the data from the standings table. The table includes a wins, losses, and win percentage column. I will target the TABLE elements on the page and identify the relevant table by its class name. Once extracted, I will convert the table into a data frame, clean it if necessary, and sort teams by win percentage to identify the “best” teams.
Visualizations
Here is a visualization that ranks all the teams in the NBA based on their win percentage during the season:
Here are the top five teams (who I think have the best chance of winning the finals) based off win percentage:
Here is a comparison of conferences (East vs West) based on total wins for all the teams within:
Here is a box plot that shows how the two conferences compare based on win percentage:
Here is a histogram that shows the distribution of win percentages and where the teams stacked up:
Final Analysis
My analysis of NBA standings for the 2024–25 season reveals clear performance trends across the league. The full team win percentage chart shows a wide spread in team success, with several teams performing well below or above the league average. Highlighting the top five teams by win percentage provides a better view of top performance, these teams included the Oklahoma City Thunder, Boston Celtics, Cleveland Cavaliers, Houston Rockets, and New York Knicks. Additionally, the comparison of total wins by conference shows a somewhat balanced distribution of wins between the Eastern and Western Conferences. This suggests competitiveness across the conference level despite differences among individual teams. These visualizations help illustrate both the dominance of top-performing teams and the overall balance in league structure.
The box plot of win percentages by conference offers a deeper look into the performance within each conference. This is particularly useful for comparing the relative competitiveness of the conferences, ultimately showing one conference, the West, had “better” teams this season, but the East had two of the three top teams in the league. The histogram showing the distribution of win percentages across all NBA teams provides valuable insight into how teams are performing overall in the 2024-25 season. By visualizing the win percentage distribution, I can identify patterns such as most teams aren’t clustered around a particular performance range, but there are a few teams with extremely high or low win percentages (outliers), helping me better understand the competitiveness of the league.
Together, these visualizations provide a better picture of overall team performance and conference dynamics in the NBA.