Introduction

This report provides insight into the free throws attempted in the NBA, from 2006 to 2016. With over 618,019 free throws attempted, over the 10 year span, with an average over 61,802 attempted per year, free throws play a large role in the NBA season. Free throws are integral part in the success of a team throughout the season, as they are easier to make and result in higher percent made compared to field goals. Many of the leagues highest regarded players appear in the top 10 free throw attempts over this period of time, demonstrating the affect on individual success in the game. In the National Basketball Association, a free throw is rewarded in two different ways. The first way is designated as a shooting foul. This occurs when a player attempts a field goal during the active play, and is fouled in a manner that effects this ability to complete the shot under normal playing conditions. If a shooting foul is called, and the player makes the shot anywhere on the court, the original basket will count, and the player will attempt one shot from the free throw line. If the player does not make the shot when the foul is called, the player is awarded either two or three shots, depending on the location of the shooting player during the original shot attempt. The other way a foul shot is awarded, is if a team commits over five fouls in a quarter. If a team has between five and nine fouls in the half, the player is awarded one free throw, and once a team commits ten or more fouls in the half, the opposing team will receive two shots. This report can be used to evaluate the tendencies of free throw activity throughout the seasons to understand the effect they have on the game.

Dataset

This data set is comprised of over 618,000 attempted free throws attempted, over a 10 year span, from the 2006 to 2016 season. The data set was sourced from the public domain website, kaggle.com. The Data within the spread sheet was derived from ESPN and the many stats pages in their archives. This data includes over 11 variables that describe the teams played, final score, player, season, whether or not the free throw was successful, current score, period, time in the period, and regular season or playoffs. As the data only ranges from 2006 to 2016, which was the last time the data was updated(2016).

library(readr)
library(ggplot2)
library(tidyr)
library(dplyr)
library(scales)
library(RColorBrewer)
library(ggthemes)

setwd("~/Desktop/School/Loyola/NBA_R")

df <- read.csv("~/Desktop/School/Loyola/NBA_R/free_throws 2.csv")
scoreha_df <- df
scoreha_df$season <- as.factor(scoreha_df$season)

Findings

Top 10 Free Throw attempts by Player per Year

The stacked bar chart below breaks down the total attempted free throws, by year, for the 10 players who attempted the most free throws, over the 10-year span from 2006 to 2016. The graphic shows that most of these players, who attempted the most free throws, were very consistent in their ability to get the free throw line. There also is an indication that the players who get to the free throw line the most, are viewed as more successful basketball players. Four of these players, Dirk Nowitzki, Kevin Durant, Kobe Bryant, and LeBron James won an MVP trophy during this time span. In fact, Lebron James, who attempted the most free throws with 8,001, won four MVP trophies in that time span.

tot_att <-data.frame(count(scoreha_df, player))
tot_att <-tot_att[order(tot_att$n, decreasing = TRUE),] #sort descending, will give the highest number of free throws
top10_tot_att <- scoreha_df[scoreha_df$player %in% c("LeBron James","Dwight Howard", "Kevin Durant", "Dwyane Wade", "Kobe Bryant",
                                                     "Carmelo Anthony", "Dirk Nowitzki", "James Harden", "Russell Westbrook", "Chris Bosh"),]
df_top10_tot_att <- count(top10_tot_att, player, season)
tot_att2 <- tot_att[tot_att$player %in% c("LeBron James","Dwight Howard", "Kevin Durant", "Dwyane Wade", "Kobe Bryant",
                                          "Carmelo Anthony", "Dirk Nowitzki", "James Harden", "Russell Westbrook", "Chris Bosh"),]
#Stacked Bar Chart, players with the most free throws attempted from 2006-2016 and their attempts per year
ggplot(df_top10_tot_att, aes(x = reorder(player, n, sum), y = n , fill = season)) +
  geom_bar(stat = "identity", position = position_stack(reverse = TRUE)) +
  labs(title = "Top 10 Free Throw attempts by Player Between 2006-2016", x= "Player", y = "Free Throw Attempts", fill = "Season") +
  theme_minimal()+
  theme(plot.title = element_text(hjust = 0.5))+
  scale_fill_brewer(palette = "Spectral", guide = guide_legend(reverse = TRUE))+
  geom_text(data = tot_att2, aes(x=player, y = n, label = scales::comma(n), fill=NULL), vjust = -0.5, size = 3)+
  scale_y_continuous(labels = comma,)

Total Free-Throws Attempted by Period as a Percent (’06-’16)

The Pie Chart below depicts the percent of free throws attempted each season, in each time period: quarter 1, quarter 2, quarter 3, quarter 4, and overtime. Over the span of the 10-years, there is a consistent trend over the percent free throws attempted each quarter; as time played in regulation increases, so does the number of free throws attempted. The first quarter measures close to 20%, the second and third quarters measure near 25% and in the fourth quarter free throw attempts increase to about 30% of the total attempted free throws. Although total overtime minutes played is drastically less than regulation, it normally accounts for about 1% of free throws attempted, which can have a large effect on the outcome of the game.

ft_quar <- data.frame(count(scoreha_df, season, period))

ft_quar2 <- ft_quar %>%
  select(season, period, n) %>%
  group_by(season)%>%
  summarise(total = (n)/sum(n), .groups = 'keep')

ft_quar2 <- cbind(ft_quar2,ft_quar) 

ft_quar2 <- subset(ft_quar2, select = -c(season...3,n))
colnames(ft_quar2)[1] <- "Season"
ft_quard <- ft_quar2[order(ft_quar2$total, decreasing = TRUE),]
ft_quard <-ft_quard$period[1:40]

ftquar3 <- ft_quar2 %>% 
  filter(period %in% ft_quard) %>%
  select(Season, period, total) %>%
  group_by(Season) %>%
  data.frame()
ftot <- ft_quar2 %>% 
  filter(!period %in% ft_quard) %>%
  select(Season,total) %>%
  mutate(period = "Overtime")%>%
  group_by(Season , period)%>%
   summarise(total = sum(total),.groups = 'keep')%>%
  data.frame()

ftquar3 <- rbind(ftquar3, ftot)
ftquar3 <- ftquar3 %>%
  group_by(Season) %>%
  data.frame()

ftquar3$total <- round(ftquar3$total, digits = 3)

ggplot(data = ftquar3, aes(x = "", y = total, fill = period)) +
  geom_bar(stat = "identity", position = "fill") +
  coord_polar(theta = "y", start = 0) +
  labs(fill = "Period", x = NULL , y = NULL , title = "Total Free-Throws Attempted by Period as a Percent ('06-'16)")+
  theme_minimal()+
  theme(plot.title = element_text(hjust =0.5),
        axis.text = element_blank(),
        axis.ticks = element_blank(),
        panel.grid = element_blank())+
  facet_wrap(~Season, ncol = 4 , nrow = 3)+
  scale_fill_brewer(palette = "RdYlBu")+
  geom_text(aes(x = 1.2, label = percent(total)),
            size = 2,
            position = position_fill(vjust = 0.4),)

Total Free-Throws Attempted per Year

The bar chart below depicts the total number of free throws attempted by the NBA, per season. Between 2006-2011, there is little volatility year over year, and a slight decreasing relationship, for the total attempts. In 2012, there was a major decrease of about 25% in the total free throw attempts. While this could potential be seen as a bit of an outlier, there is good reason for this decrease. In 2012, the NBA rules committee came together and came out with a set of “Points of Emphasis” for the referees, which included stricter rules against offensive players dramatizing plays to earn free throw attempts. Following 2012, there was an large increase in 2013 near 58,000 free throws attempted, establishing a new relative average in the number of free throws attempted till 2016.

#new DF for attempted free throws in season
overall <- ft_quar %>%
  select(season,n)%>%
  group_by(season)%>%
  summarise(totalAt = sum(n), .groups = 'keep')%>%
  data.frame()

#bar chart - number of free throws attempted
ggplot(overall, aes(x = season, y = totalAt)) +
  geom_bar(colour = "Black", fill = "darkslateblue", stat = "identity") +
  theme_minimal() +
  labs(title = "Number of Attempted Free Throws per Season", x = "Season", y = "Total Attempts")+
  theme(plot.title = element_text(hjust = 0.5))+
  geom_text(data = overall, aes(x = season, y = totalAt, label = scales::comma(totalAt), fill = NULL ), vjust= -0.4, size = 3)+
  scale_y_continuous(labels = comma, breaks = seq(0, 70000, 5000 ), limits = c(0,70000))

Percentage of Free Throws made per Period per Year

The Line plot below illustrates the free throw percentage by period, over each year from 2006 to 2016. All of the orange and red lines represent the time periods in regulation. These periods have a large number of observations, which will limit their variability, but they do trend in the same direction as each season changes. There appears to be a slight correlation between the total number of free throws attempted and the percent made free throws in the periods. The highest average made free throw percentage, across all periods, is in ’08-’09, which in that same year, the third most attempted free throws occurred (See Bar Chart). There is a recognizable a slight decrease in the 2011-2012 and 2012-2013 seasons, when the NBA saw a dramatic decrease in total free throws. The overtime periods have a much smaller sample size, which increase the variability in the data, but loosely produce many of the same trends observed by the regulation periods. Maybe practice does make perfect.

season_att <- data.frame(count(scoreha_df, period, season, shot_made))
season_att$period <- as.factor(season_att$period)
sznatt <- season_att %>%
  select(period, season, shot_made, n) %>%
  group_by(period, season)%>%
  summarise(PshotM = (n)/sum(n), .groups = 'keep')
sznatt2 <- sznatt[-seq(1, NROW(sznatt), by = 2),]

ggplot(sznatt2, aes(x = season, y = PshotM, group=period)) +
         geom_line(aes(color=period), size = 2) + 
  labs(title = "Percentage of Free Throws Made per Period per Year", x = "Season" , y = "% Made") + 
  theme_minimal()+
  theme(plot.title = element_text(hjust = 0.5))+
  geom_point(shape = 21, size = 3, color = "black", fill = "grey")+
  scale_y_continuous(labels = percent, breaks = seq(0, 1, .05 ), limits = c(.6,1))+
  scale_color_brewer(palette = "RdYlBu",name = "Period")

Heat Map: % Free Throws Made - Top 10 Player Attempts

The chart below is a heat map of the players who attempted the most free throws from 2006 to 2016 and their respective free throw percentages for the season. It must be noted that three of the players, Kevin Durant, James Harden, and Russell Westbrook did not enter the NBA until 2007, 2009, and 2008 respectively. They still were able to attempt enough free throws in the following years to accrue enough attempts to land in the top 10 players in that time span. The heat map demonstrates that most all the players were very consistent year over year in the percent free throws made. That trend also includes the poor shooting performance demonstrated by Dwight Howard over his career.

player <- data.frame(count(scoreha_df, player, season, shot_made))
playerp <- player %>%
  select(player, season, shot_made, n) %>%
  group_by(player, season)%>%
  summarise(pplayer = (n)/sum(n), .groups = 'keep')

playerp2 <- playerp[playerp$player %in% c("LeBron James","Dwight Howard", "Kevin Durant", "Dwyane Wade", "Kobe Bryant",
                                                     "Carmelo Anthony", "Dirk Nowitzki", "James Harden", "Russell Westbrook", "Chris Bosh"),]
playerp2$pplayer <- round(playerp2$pplayer, digits = 2)
playerp2<- playerp2[-seq(1, 100, by = 2,),]
playerp2<- playerp2[-seq(51, nrow(playerp2), by = 2,),]

#Heatmap
ggplot(playerp2, aes(x = season, y = player , fill = pplayer)) +
  geom_tile(color = "black") +
  geom_text(aes(label = percent(pplayer))) +
  coord_equal(ratio = 1) +
  labs(title = " Heat Map : % Free Throws Made - Top 10 Player Attempts ('06-'16)",
       x = "Season", y = "Player", fill = "% Made") +
  theme_classic() +
  theme(plot.title = element_text(hjust = 0.5)) +
  scale_fill_continuous(low = "yellow", high = "green", labels = percent, breaks = seq(0, 1, .05), limits = c(.7,.96))

Conclusion

Overall, the data suggest that the observed tendencies in free throw activity, within the NBA season, can indicate success for players and create a narrative about their importance on the outcome of the game. Many players who were on the top 10 list for most free throws attempted, in that time span, were named MVP candidates. In fact, 60% of those MVP votes were won by a player on that same list. Not only are they of high importance in a players individual success, but they also have a definite importance in the games themselves. There was a noticeable increase in the number of attempted free throws as the game time increased. This indicates that players were either more aggressive in crunch time, when the game was on the line, or a team was strategically fouling to hopefully extend their time of possession, late in the game, to potentially close the score. The data also suggests that the free throw had such a large effect on the sport that an outside variable, the “Points of Emphasis” issued by the rules committee, was needed to control some of the effect they had on the game. It is clear that no matter the play or time, the free throw, has a monumental effect on the game of basketball.