Today in class we covered seasonal variation. Constant seasonal variation is good and increasing seasonal variation is bad. When you see increasing seasonal variation, you want to try and find a transform that creates constant seasonal variation.

library(faraway)
## Warning: package 'faraway' was built under R version 3.4.4
data("airpass")
attach(airpass)
plot(pass~year, type="l")

passy<-(pass)^(.1)
plot(passy~year, type="l")

In the first graph we can see that there is increasing seasonal variation. Again, this is a bad thing. So, we need to do a transformation to get the data to have constant seasonal variation. While not shown in the data above, I tried a few different transformations. The transformation above (pass^.1) is the transformation that gave the most constant seasonal variation. Essentially, to see if a variable transformation has more constant seasonal variation, you just visually inspect the graphs.

We also talked about modeling seasonal variation using dummy variables. This is quite a bit of code to demonstrate the dummy variable variation, so instead I will just discuss it. This is extremely similar to the dummy variables we used in the MLR setting. Basically you can use dummy variables to better model the seasonal variation in a model. You can then do t-tests to see which dummy variables are useful in predicting the seasonal variation and toss out the useless predictors.