#------------ # seasonality #------------ Read("http://web.pdx.edu/~gerbing/data/seasonality.csv") # create a time series of the data F.ts <- ts(Y, start=c(2001,1), frequency=4) pdf("season_data.pdf", 6, 4) plot(F.ts) dev.off() # autocorrelations and plot by lag cc <- acf(F.ts) cc pdf("season_acf.pdf", 6, 4) plot(acf(Y)) dev.off() # seasonal and trend decomposition of time series decomp <- stl(F.ts, s.window="periodic") decomp pdf("season_decomp.pdf", 6, 4) plot(decomp) dev.off() # Holt-Winters exponential smoothing with trend and seasonal components hw <- HoltWinters(F.ts) hw pdf("season_HW.pdf", 6, 4) plot(hw) dev.off()