Seasonal Plots

Approaches for visualizing seasonality.

Kris Sankaran (UW Madison)
01-10-2023

Reading, Recording, Rmarkdown

  1. If our data have seasonal structure, it’s natural to compare individual periods against one another. In contrast to plotting the data in one long time series, seasonal plots reduce the amount of distance our eyes have to travel in order to compare two periods in a seasonal pattern. This also reduces the burden on our memory.

  2. In R, we can use the gg_season function to overlay all the seasons onto one another. The plot below shows antidiabetes drug sales over time. This view makes it clear that there is a spike in sales every January.

cols <- scales::viridis_pal()(10)
gg_season(as_tsibble(a10), pal = cols)

  1. If the time series exhibit seasonal structure at multiple scales, then we can view them all using the period argument.
gg_season(vic_elec, Demand, period = "day", pal = cols)
gg_season(vic_elec, Demand, period = "week", pal = cols)

Citation

For attribution, please cite this work as

Sankaran (2023, Jan. 10). STAT 436 (Spring 2023): Seasonal Plots. Retrieved from https://krisrs1128.github.io/stat436_s23/website/stat436_s23/posts/2022-12-27-week06-03/

BibTeX citation

@misc{sankaran2023seasonal,
  author = {Sankaran, Kris},
  title = {STAT 436 (Spring 2023): Seasonal Plots},
  url = {https://krisrs1128.github.io/stat436_s23/website/stat436_s23/posts/2022-12-27-week06-03/},
  year = {2023}
}