X13 Procedure

Basic Seasonal Adjustment

(View the complete code for this example.)

Suppose that you have monthly retail sales data starting in September 1978 in a SAS data set named SALES. At this point, you do not suspect that any calendar effects are present, and there are no prior adjustments that need to be made to the data.

In this simplest case, you need only specify the DATE= variable in the PROC X13 statement and request seasonal adjustment in the X11 statement as shown in the following statements:

data sales;
   set sashelp.air;
   sales = air;
   date = intnx( 'month', '01sep78'd, _n_-1 );
   format date monyy.;
run;
proc x13 data=sales date=date;
   var sales;
   x11;
   ods select d11;
run;

The results of the seasonal adjustment are in Table D11 (the final seasonally adjusted series) in the displayed output shown in Figure 1.

Figure 1: Basic Seasonal Adjustment

The X13 Procedure

Table D 11: Final Seasonally Adjusted Data
For Variable sales
YearJANFEBMARAPRMAYJUNJULAUGSEPOCTNOVDECTotal
1978........124.560124.649124.920129.002503.131
1979125.087126.759125.252126.415127.012130.041128.056129.165127.182133.847133.199135.8471547.86
1980128.767139.839143.883144.576148.048145.170140.021153.322159.128161.614167.996165.3881797.75
1981175.984166.805168.380167.913173.429175.711179.012182.017186.737197.367183.443184.9072141.71
1982186.080203.099193.386201.988198.322205.983210.898213.516213.897218.902227.172240.4532513.69
1983231.839224.165219.411225.907225.015226.535221.680222.177222.959212.531230.552232.5652695.33
1984237.477239.870246.835242.642244.982246.732251.023254.210264.670266.120266.217276.2513037.03
1985275.485281.826294.144286.114293.192296.601293.861309.102311.275319.239319.936323.6633604.44
1986326.693330.341330.383330.792333.037332.134336.444341.017346.256350.609361.283362.5194081.51
1987364.951371.274369.238377.242379.413376.451378.930375.392374.940373.612368.753364.8854475.08
1988371.618383.842385.849404.810381.270388.689385.661377.706397.438404.247414.084416.4864711.70
1989426.716419.491427.869446.161438.317440.639450.193454.638460.644463.209427.728485.3865340.99
1990477.259477.753483.841483.056481.902499.200484.893485.245....3873.15
Avg277.330280.422282.373286.468285.328288.657288.389291.459265.807268.829268.774276.446 

Total: 40323 Mean: 280.02 S.D.: 111.31
Min: 124.56 Max: 499.2



You can compare the original series (Table A1) and the final seasonally adjusted series (Table D11) by plotting them together as shown in Figure 2. These tables are requested in the OUTPUT statement and are written to the OUT= data set. Note that the default variable name used in the output data set is the input variable name followed by an underscore and the corresponding table name.

proc x13 data=sales date=date noprint;
   var sales;
   x11;
   output out=out a1 d11;
run;

proc sgplot data=out;
   series x=date y=sales_A1 / name = "A1" markers
                              markerattrs=(color=red symbol='asterisk')
                              lineattrs=(color=red);
   series x=date y=sales_D11 / name= "D11" markers
                               markerattrs=(symbol='circle')
                               lineattrs=(color=blue);
   yaxis label='Original and Seasonally Adjusted Time Series';
run;

Figure 2: Plot of Original and Seasonally Adjusted Data

Plot of Original and Seasonally Adjusted Data


Last updated: June 19, 2025