X11 Procedure

Basic Seasonal Adjustment

(View the complete code for this example.)

Suppose 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 MONTHLY statement, which associates a SAS date value to each observation. To see the results of the seasonal adjustment, you must request table D11, the final seasonally adjusted series, in a TABLES statement.

data sales;
   input sales @@;
   date = intnx( 'month', '01sep1978'd, _n_-1 );
   format date monyy7.;
datalines;
112 118 132 129 121 135 148 148 136 119 104 118

   ... more lines ...   

/*--- X-11 ARIMA ---*/
proc x11 data=sales;
   monthly date=date;
   var sales;
   tables d11;
run;

Figure 1: Basic Seasonal Adjustment

The X11 Procedure
 
Seasonal Adjustment of - sales

X-11 Seasonal Adjustment Program
U. S. Bureau of the Census
Economic Research and Analysis Division
November 1, 1968
 
The X-11 program is divided into seven major parts.
Part Description
A. Prior adjustments, if any
B. Preliminary estimates of irregular component weights
and regression trading day factors
C. Final estimates of above
D. Final estimates of seasonal, trend-cycle and
irregular components
E. Analytical tables
F. Summary measures
G. Charts
 
Series - sales
Period covered - 9/1978 to 8/1990
Type of run: multiplicative seasonal adjustment.
Selected Tables or Charts.
Sigma limits for graduating extreme values are 1.5 and 2.5
Irregular values outside of 2.5-sigma limits are excluded
from trading day regression


Figure 2: Basic Seasonal Adjustment

D11 Final Seasonally Adjusted Series
YearJANFEBMARAPRMAYJUNJULAUGSEPOCTNOVDECTotal
1978........123.507125.776124.735129.870503.887
1979124.935126.533125.282125.650127.754129.648127.880129.285126.562134.905133.356136.1171547.91
1980128.734139.542143.726143.854148.723144.530140.120153.475159.281162.128168.848165.1591798.12
1981176.329166.264167.433167.509173.573175.541179.301182.254187.448197.431184.341184.3042141.73
1982186.747202.467192.024202.761197.548206.344211.690213.691214.204218.060228.035240.3472513.92
1983233.109223.345218.179226.389224.249227.700222.045222.127222.835212.227230.187232.8272695.22
1984238.261239.698246.958242.349244.665247.005251.247253.805264.924266.004265.366277.0253037.31
1985275.766282.316294.169285.034294.034296.114294.196309.162311.539319.518318.564323.9213604.33
1986325.471332.228330.401330.282333.792331.349337.095341.127346.173350.183360.792362.3334081.23
1987363.592373.118368.670377.650380.316376.297379.668375.607374.257372.672368.135364.1504474.13
1988370.966384.743386.833405.209380.840389.132385.479377.147397.404403.156413.843416.1424710.89
1989428.276418.236429.409446.467437.639440.832450.103454.176460.601462.029427.499485.1135340.38
1990480.631474.669486.137483.140481.111499.169485.370485.103....3875.33
Avg277.735280.263282.435286.358285.354288.638288.683291.413265.728268.674268.642276.442 

Total: 40324 Mean: 280.03 S.D.: 111.31



You can compare the original series, Table B1, and the final seasonally adjusted series, Table D11, by plotting them together. These tables are requested and named in the OUTPUT statement.

title 'Monthly Retail Sales Data (in $1000)';

proc x11 data=sales noprint;
   monthly date=date;
   var sales;
   output out=out b1=sales d11=adjusted;
run;

proc sgplot data=out;
   series x=date y=sales    / markers
                            markerattrs=(color=red symbol='asterisk')
                            lineattrs=(color=red)
                            legendlabel="original" ;
   series x=date y=adjusted / markers
                            markerattrs=(color=blue symbol='circle')
                            lineattrs=(color=blue)
                            legendlabel="adjusted" ;
   yaxis label='Original and Seasonally Adjusted Time Series';
run;

Figure 3: Plot of Original and Seasonally Adjusted Data

Plot of Original and Seasonally Adjusted Data


Last updated: June 19, 2025