Approaches for visualizing seasonality.
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.
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)
period
argument.gg_season(vic_elec, Demand, period = "day", pal = cols)
gg_season(vic_elec, Demand, period = "week", pal = cols)
For attribution, please cite this work as
Sankaran (2024, Jan. 7). STAT 436 (Spring 2024): Seasonal Plots. Retrieved from https://krisrs1128.github.io/stat436_s24/website/stat436_s24/posts/2024-12-27-week06-03/
BibTeX citation
@misc{sankaran2024seasonal, author = {Sankaran, Kris}, title = {STAT 436 (Spring 2024): Seasonal Plots}, url = {https://krisrs1128.github.io/stat436_s24/website/stat436_s24/posts/2024-12-27-week06-03/}, year = {2024} }