on 12-23-2016 01:55 AM
Hej alla nordiska SAS-användare!
This juletip is a friendly reminder to look at all the options when transforming data for time series analysis, forecasting or predictive modeling. Provided examples come from the time series world.
Often when working with econometric models, a couple of assumptions should be met. Mostly, models’ usability and precision is validated by examining the distribution of the residuals and testing the residuals for independence.
If these assumptions aren’t met, one remedy to get “better” residuals is to use the logarithm of the target variable instead of the actual value of the target variable. This is also taught in many classes. This is all good, but there are many other options, as this juletip tries to point out.
After this technique is used, and the logarithm still doesn’t do the trick to enhance the residuals, one of three methods is normally applied:
However, there are many more transformations than just the logarithm to use, and these are very easy to implement and use in SAS. Especially when creating time series data through PROC TIMESERIES.
These are (including the logarithm!):
Have in mind that these need the time series to be strictly positive.
And here is what the syntax looks like:
Check them out before you become an ostrich, an escape artist, or a comfortable old cat!
If your target is forecasting or prediction and you’ve finished your analysis with golden, shiny residuals – do not forget to transform your target variable and the forecast/prediction of your target variable back to its normal, i.e. if you use the square root to transform your data, square it back afterwards!
- For other econometric models there are other procedures which’ll help you transform your data to make it apt for analysis, for example PROC TRANSREG.
- In time series analysis, ask yourself if you are using the right accumulation for your time series; is it always the total or average you need to be looking at? For capacity forecasts, the maximum might be more apt.
- For time series analysis, PROC EXPAND provides even more transformations. Maybe Santa will tell you all about it next Christmas. Until then – or if he doesn’t - don’t forget our community and the support site!
For in-detail reading:
Merry Christmas and normally (or at least identically) distributed residuals to all of you!