liveBook · Manning

Team turnover

As explained in Statistics Slam Dunk

Churn is a book-specific dataset copied from records and augmented with team ranking and year-over-year postseason-status variables.

Team turnover measures year-over-year movement among the NBA’s strongest teams. In this analysis, churn counts teams entering the top eight in regular-season wins after missing that group the previous season. section 18.5 section 18.5.2

Prepare the churn dataset by deriving comparable team-season indicators:

  • Copy the records data into churn and remove postseason asterisks from Team names with gsub(). section 18.5.1
  • Group by Season and rank teams by descending regular-season wins, assigning tied win totals the same average rank. section 18.5.1
  • Mark ranks 1 through 8 with topTeam = 1 and all lower-ranked teams with topTeam = 0. section 18.5.1
  • Arrange each team’s seasons from newest to oldest and use lead() to create topTeam2, representing its prior-season status. section 18.5.1
  • Count records where topTeam exceeds topTeam2, then retain the TRUE counts as annual turnover. section 18.5.2

Reading a turnover count

If a season records three teams with topTeam = 1 and topTeam2 = 0, three new teams entered the top eight compared with the preceding season. A line chart can compare these counts before and after the salary cap introduced before 1984–85. section 18.5.2

p7 <- ggplot(churn_tbl, aes(x = Season, y = n, group = 1)) + 
 geom_line(aes(y = n), color = "black", size = .5) + 
 geom_point(size = 5, color = "orange") +
 labs(title = "Year-over-Year Churn in the NBA's Top 8",
      subtitle = "1971-98",
      x = "Season", 
      y = "Number of New Top 8 Teams from Prior Season",
      caption = "salary cap was introduced prior to the 1984-85 season") +
 ylim(0, 6) +
 theme(plot.title = element_text(face = "bold")) +
 theme(axis.text.x = element_text(angle = 45, hjust = 1)) +
 geom_smooth(method = lm, color = "red", se = FALSE, 
             data = churn_tbl[as.character(churn_tbl$Season) <
                                "1984-85",]) +
 geom_smooth(method = lm, color = "red", se = FALSE, 
             data = churn_tbl[as.character(churn_tbl$Season) > 
                                "1983-84",]) +
 annotate("rect", xmin = "1971-72", xmax = "1983-84",
   ymin = 0, ymax = 6, alpha = 0.1, fill = "blue") +
 annotate("rect", xmin = "1984-85", xmax = "1997-98",
   ymin = 0, ymax = 6, alpha = 0.1, fill = "green") 
print(p7)

Inspect the ggplot2 construction for the year-over-year top-eight churn chart, including pre- and post-salary-cap trend lines. section 18.5.2

How Statistics Slam Dunk covers it

How deep it goes
Builds churn from cleaned team names, tied seasonal ranks, prior-season indicators, logical counts, and a segmented trend chart.
Examples
Uses NBA team-season records, top-eight status flags, annual counts, and a 1971–98 line chart split at the 1984–85 salary-cap introduction.
What you can do after
Apply it via R to compute annual top-eight turnover and visualize pre- and post-salary-cap trends.
How it connects
Connects churn with statistical dispersion, inter-season parity, regular-season wins, team ranking, and the NBA salary cap.

Related concepts

This explainer was generated by Manning's knowledge graph from the text of Statistics Slam Dunk. The section links point to the parts of the book it draws on.