I found this code online and I wanted to dissect it before programming something similar in SAS.

The problem is idenitfy seasonality in a time series. I want to understand the code line by line:

proc x12 data=sales date=date season=12;
      var unempl_rate *already log differenced;
      transform function=none;
      regression predefined=td;
      automdl maxorder=(1,1)
              print=unitroottest unitroottestmdl autochoicemdl best5model;
      output out=out(obs=23) a1 d11 d18;
   proc print data=out(obs=23);
      title 'Output Variables Related to Trading Day Regression';

By line:

  1. the first line just defined use the x12 procedure with data set called "sales" - monthly data, indexed by variable "date" and expect a seasonality in the data every 12 months.
  2. this line tells which variable to analyze.
  3. no transformation was necessary since a transformation was already done.
  4. this line confuses me a little, is "regression predifined=td" applied for adjustment/outliers/events?

5-7. do these lines mean to estimate the best ARIMA (linear) models on the residual? 8-onwards. For outputing results


You can find a thorough description of the methodology at Census web site, here. The current routine is X-13ARIMA-SEATS, it's very popular beyond Census Bureau.

In old days they used X-13. If you have annual seasonality in monthly series, then this is the way to go. They supply the routine for download. They have a ton of references on the subj.

MATLAB has a few examples with code and detailed explanations, e.g. see here


Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.