A quarter is one of four 12-minute periods in a regulation NBA game. A quarter result records which team scored more points during that period, or whether the teams tied. section 6.0
Quarter-by-quarter results connect partial-game performance with the final outcome. Comparing the team that won a quarter with the eventual game winner tests whether that period predicted victory. section 6.4
Useful quarter-result comparisons include:
- Compare first-, second-, third-, and fourth-quarter winners with the eventual game winner. section 6.4
- Separate home and road teams to see whether quarter wins predict outcomes differently by venue. section 6.4
- Restrict the data to games tied at halftime when comparing third- and fourth-quarter results. section 6.4
Fourth-quarter result
In the analyzed games, teams that won the fourth quarter also won the game nearly 66% of the time. The rate was about 72% for home teams and 58% for road teams, so a fourth-quarter win was informative but not decisive. section 6.4.4
nbadf2 %>%
filter(Q4R != Q4H) -> nbadf6
nbadf6 %>% mutate(Q4vF = case_when(Q4H > Q4R & FH > FR ~ "HH",
Q4R > Q4H & FR > FH ~ "RR",
Q4H > Q4R & FR > FH ~ "HR",
Q4R > Q4H & FH > FR ~ "RH")) -> nbadf6
nbadf6$Q4vF <- factor(nbadf6$Q4vF)
count(nbadf6, Q4vF) %>% arrange(desc(n)) -> tbl4
tbl4 %>%
mutate(pct_total = n/nrow(nbadf6)*100) %>%
mutate(cum_n = cumsum(n)) %>%
mutate(cum_pct_total = cumsum(pct_total)) -> tbl4
tbl4$pct_total <- round(tbl4$pct_total, digits = 2)
tbl4$cum_pct_total <- round(tbl4$cum_pct_total, digits = 2)
print(tbl4)
## Q4vF n pct_total cum_n cum_pct_total
## 1 HH 767 39.05 767 39.05
## 2 RR 524 26.68 1291 65.73
## 3 RH 374 19.04 1665 84.78
## 4 HR 299 15.22 1964 100.00
plot4a <- ggplot(tbl4, aes(x = reorder(Q4vF, -n), y = n)) +
geom_bar(color = c("darkorchid3", "darkorchid3", "gray74", "gray74"),
fill = c("darkorchid3", "darkorchid3", "gray74", "gray74"),
stat = "identity") +
labs(title = "Teams Winning the Fourth Quarter",
subtitle = "Win-Loss Record = 1,291-673",
x = "Win Combinations",
y = "Wins") +
geom_text(aes(x = Q4vF, y = n, label = n,
vjust = -0.3, fontface = "bold")) +
theme(plot.title = element_text(face = "bold"))
plot4b <- ggplot(tbl4, aes(x = reorder(Q4vF, -pct_total), y = pct_total)) +
geom_bar(color = c("darkorchid3", "darkorchid3", "gray74", "gray74"),
fill = c("darkorchid3", "darkorchid3", "gray74", "gray74"),
stat = "identity") +
labs(title = "Teams Winning the Fourth Quarter",
subtitle = "Winning Percentage = 65.73%",
x = "Win Combinations",
y = "Winning Percentage") +
geom_text(aes(x = Q4vF, y = pct_total, label = pct_total,
vjust = -0.3, fontface = "bold")) +
theme(plot.title = element_text(face = "bold"))
plot4a + plot4b + plot_layout(ncol = 2)
The R workflow filters tied fourth quarters, classifies quarter-versus-final results, counts each outcome pattern, and calculates percentages and cumulative totals. section 6.4.4
