chapter six

6 Are games really won in the fourth quarter?

 

This chapter covers

  • Subsetting data sets
  • Separating and joining data sets
  • Renaming and converting variables
  • Creating and customizing bar charts

According to conventional wisdom, no doubt influenced by late-game bias where the final plays in a close game create the most indelible memories, NBA games are won in the fourth quarter. In other words, teams that win the fourth quarter and play best down the stretch, regardless of what might have happened over the first three quarters, will usually be victorious. Which is to suggest that the last 12 minutes of an NBA game are more significant than the first 36 minutes (NBA games are 48 minutes in duration divided into four 12-minute quarters).

Our objective here is to determine if this conventional wisdom has any validity or, alternatively, if this is perhaps an illusion that might be due to the conspicuousness of fourth quarter results, especially when games are tight after the first three quarters of play.

6.1 Loading packages

We start by loading the three packages we’ll need to wrangle, query, and visualize data in ways that are above and beyond the capabilities of base R by making a series of calls to the library() function. All of these packages should be familiar to you by now.

library(tidyverse)
library(sqldf)
library(patchwork)

But heads up: there is a lot of data wrangling in this chapter.

6.2 Importing data

6.3 Wrangling data

6.3.1 Subsetting data sets

6.3.2 Joining data sets

6.4 Analysis

6.4.1 Quarter-by-quarter analysis

6.4.2 Best and worst teams

6.4.3 Second half results