library(fpp2)
library(ggplot2)
Reading the data into R with the following script:
retaildata <- readxl::read_excel("retail.xlsx", skip = 1)Selecting one of the time series (A3349398A - Turnover; New South Wales; Food retailing)
myts <- ts(retaildata[,"A3349398A"], frequency=12, start=c(1982,4))Exploring the chosen retail time series using the following functions: autoplot(), ggseasonplot(), ggsubseriesplot(), gglagplot(), ggAcf()
autoplot(myts)
ggseasonplot(myts)
ggseasonplot(myts, polar = TRUE)
ggsubseriesplot(myts)
gglagplot(myts)
#gglagplot(window(myts, start=2009))
ggAcf(myts)
Finding any seasonality, cyclicity and trend:
A near linear positive trend is made very evident by the autoplot(). It can also be seen by the ggseasonplot() in polar coordinates. The chart looks like a cross section of a tree trunk, with rings showing yearly growth each year. The seasonality of 12 month is best revealed by the gglagplot plot which shows a nearly straight line in the section with lag 12. Finally, there is no evidence of any cyclic behaviour by looking at the autoplot().
Learning about the series:
By looking at the ggseasonplot() plots or better yet by looking at the ggsubseriesplot(), it is evident that February and June have the lowest averages, while December has the highest.