NBA Dataset

Loading in the data
Filtering out unnecessary games for this analysis

Create the Time Column

Change the Game Date to a Date format

Create a tsibble

Plot the Data Over Time

Plot the Data

nba_ts |>
  ggplot(aes(x = game_date, y = pts_home)) +
  geom_line(alpha = 0.4) +
  labs(
    title = "Home Points Over Time",
    x = "Date",
    y = "Home Points"
  ) +
  theme_minimal()

This first plot gives us an idea of what the time series looks like. There are some general trends and ideas that come to mind, like it looks to be trending upwards overall with some aspects of seasonality, but we’ll do some more analysis to confirm these hypotheses.

Detect Seasonality

nba_ts |>
  ggplot(aes(game_date, pts_home)) +
  geom_line(alpha = 0.3) +
  geom_smooth(span = 0.2, se = FALSE, color = "blue") +
  labs(title = "Smoothed Home Points Over Time")
## `geom_smooth()` using method = 'gam' and formula = 'y ~ s(x, bs = "cs")'

Interpretation

  • Within‑season cycles: scoring rises mid‑season and dips late in the year

  • Across‑season cycles: scoring resets each October

  • Holiday spikes: Christmas Day games often have higher scoring

These are seasonal patterns.

Seasonality Using ACF

acf(nba_ts$pts_home, lag.max = 50)

No strong seasonality indicators visible in ACF, however there are little bumps that might be associated with the beginning of a league season. The imperfections of the data tied to the older seasons (like the 1980s) makes this a little more challenging to see, but I think there are still a few bumps visible.

Conclusion

I converted the game_date column into a proper Date object and created a tsibble containing the date and home points. Plotting the data over time revealed substantial game‑to‑game variability and a general upward drift in scoring across seasons. A linear regression of points on date confirmed a statistically significant upward trend, suggesting that NBA scoring has increased over recent years. The ACF plot showed signs of autocorrelation and repeating seasonal structure, consistent with the NBA’s annual schedule. These results suggest that both long‑term trends (league‑wide scoring increases) and seasonal cycles (within‑season scoring rhythms) shape the distribution of home points over time. Further analysis could explore team‑specific trends or the impact of rule changes on scoring patterns.