2292 ✦ Chapter 33: The X11 Procedure Dagum, E. B. (1980), The X-11-ARIMA Seasonal Adjustment Method, Statistics Canada. Dagum, E. B. (1982a), “The Effects of Asymmetric Filters on Seasonal Factor Revision,” Journal of the American Statistical Association, 77(380), 732–738. Dagum, E. B. (1982b), “Revisions of Seasonally Adjusted Data Due to Filter Changes,” Proceedings of the Business and Economic Section, the American Statistical Association, 39–45. Dagum, E. B. (1982c), “Revisions of Time Varying Seasonal Filters,” Journal of Forecasting, 1(Issue 2), 173–187. Dagum, E. B. (1983), The X-11-ARIMA Seasonal Adjustment Method, Technical Report 12-564E, Statistics Canada. Dagum, E. B. (1985), “Moving Averages,” in S. Kotz and N. L. Johnson, eds., Encyclopedia of Statistical Sciences, volume 5, New York: John Wiley & Sons. Dagum, E. B. (1988), The X-11-ARIMA/88 Seasonal Adjustment Method: Foundations and User’s Manual, Ottawa: Statistics Canada. Dagum, E. B. and Laniel, N. (1987), “Revisions of Trend Cycle Estimators of Moving Average Seasonal Adjustment Method,” Journal of Business and Economic Statistics, 5(2), 177–189. Davies, N., Triggs, C. M., and Newbold, P. (1977), “Significance Levels of the Box-Pierce Portman- teau Statistic in Finite Samples,” Biometrika, 64, 517–522. Findley, D. F. and Monsell, B. C. (1986), “New Techniques for Determining If a Time Series Can Be Seasonally Adjusted Reliably, and Their Application to U.S. Foreign Trade Series,” in M. R. Perryman and J. R. Schmidt, eds., Regional Econometric Modeling, 195–228, Amsterdam: Kluwer-Nijhoff. Findley, D. F., Monsell, B. C., Shulman, H. B., and Pugh, M. G. (1990), “Sliding Spans Diagnostics for Seasonal and Related Adjustments,” Journal of the American Statistical Association, 85(410), 345–355. Ghysels, E. (1990), “Unit Root Tests and the Statistical Pitfalls of Seasonal Adjustment: The Case of U.S. Post War Real GNP,” Journal of Business and Economic Statistics, 8(2), 145–152. Higginson, J. (1975), An F test for the Presence of Moving Seasonality When Using Census Method II-X-II Variant, StatCan Staff Paper STC2102E, Seasonal Adjustment and Time Series Analysis Staff, Statistics Canada, Ottawa. Huot, G., Chui, L., Higginson, J., and Gait, N. (1986), “Analysis of Revisions in the Seasonal Adjustment of Data Using X11ARIMA Model-Based Filters,” International Journal of Forecasting, 2, 217–229. Ladiray, D. and Quenneville, B. (2001), Seasonal Adjustment with the X-11 Method, New York: Springer-Verlag. Laniel, N. (1985), “Design Criteria for the 13-Term Henderson End-Weights,” Working Paper, Methodology Branch, Ottawa: Statistics Canada. Lehmann, E. L. (1998), Nonparametrics: Statistical Methods Based on Ranks, San Francisco: Holden-Day. References ✦ 2293 Ljung, G. M. and Box, G. E. P. (1978), “On a Measure of Lack of Fit in Time Series Models,” Biometrika, 65(2), 297–303. Lothian, J. (1978), The Identification and Treatment of Moving Seasonality in the X-11 Seasonal Adjustment Method, StatCan Staff Paper STC0803E, Seasonal Adjustment and Time Series Analysis Staff, Statistics Canada, Ottawa. Lothian, J. (1984a), The Identification and Treatment of Moving Seasonality in the X-11-ARIMA Seasonal Adjustment Method, Statcan staff paper, Seasonal Adjustment and Time Series Analysis Staff, Statistics Canada, Ottawa. Lothian, J. (1984b), “The Identification and Treatment of Moving Seasonality in X-11-ARIMA,” in Proceedings of the Business and Economic Statistics Section of the American Statistical Association, 166–171. Lothian, J. and Morry, M. (1978a), Selection of Models for the Automated X-11-ARIMA Seasonal Adjustment Program, StatCan Staff Paper STC1789, Seasonal Adjustment & Time Series Analysis Staff, Statistics Canada, Ottawa. Lothian, J. and Morry, M. (1978b), A Test for the Presence of Identifiable Seasonality When Using the X-11-ARIMA Program, StatCan Staff Paper STC2118, Seasonal Adjustment and Time Series Analysis Staff, Statistics Canada, Ottawa. Marris, S. (1961), “The Treatment of Moving Seasonality in Census Method II,” in Seasonal Adjustment on Electronic Computers, 257–309, Paris: Organisation for Economic Co-operation and Development. Monsell, B. C. (1984), The Substantive Changes in the X-11 Procedure of X-11-ARIMA, SRD Research Report Census/SRD/RR-84/10, Bureau of the Census, Statistical Research Division. Pierce, D. A. (1980), “Data Revisions with Moving Average Seasonal Adjustment Procedures,” Journal of Econometrics, 14, 95–114. Shiskin, J. (1958), “Decomposition of Economic Time Series,” Science, 128(3338). Shiskin, J. and Eisenpress, H. (1957), “Seasonal Adjustment by Electronic Computer Methods,” Journal of the American Statistical Association, 52(280). Shiskin, J., Young, A. H., and Musgrave, J. C. (1967), The X-11 Variant of the Census Method II Seasonal Adjustment Program, Technical Report 15, U.S. Department of Commerce, Bureau of the Census. U.S. Bureau of the Census (1969), X-11 Information for the User, U.S. Department of Commerce, Washington, DC: Government Printing Office. Young, A. H. (1965), Estimating Trading Day Variation in Monthly Economic Time Series, Technical Report 12, U.S. Department of Commerce, Bureau of the Census, Washington, DC. 2294 Chapter 34 The X12 Procedure Contents Overview: X12 Procedure . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 2296 Getting Started: X12 Procedure . . . . . . . . . . . . . . . . . . . . . . . . . . . . 2297 Basic Seasonal Adjustment . . . . . . . . . . . . . . . . . . . . . . . . . . 2298 Syntax: X12 Procedure . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 2301 Functional Summary . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 2302 PROC X12 Statement . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 2305 BY Statement . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 2311 ID Statement . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 2311 EVENT Statement . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 2311 INPUT Statement . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 2313 ADJUST Statement . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 2314 ARIMA Statement . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 2314 CHECK Statement . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 2315 ESTIMATE Statement . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 2316 FORECAST Statement . . . . . . . . . . . . . . . . . . . . . . . . . . . . 2318 IDENTIFY Statement . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 2318 AUTOMDL Statement . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 2320 OUTPUT Statement . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 2323 OUTLIER Statement . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 2324 REGRESSION Statement . . . . . . . . . . . . . . . . . . . . . . . . . . . 2326 TABLES Statement . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 2332 TRANSFORM Statement . . . . . . . . . . . . . . . . . . . . . . . . . . . 2332 USERDEFINED Statement . . . . . . . . . . . . . . . . . . . . . . . . . . 2334 VAR Statement . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 2334 X11 Statement . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 2334 Details: X12 Procedure . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 2339 Missing Values . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 2339 Combined Test for the Presence of Identifiable Seasonality . . . . . . . . . . 2340 Computations . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 2342 Displayed Output/ODS Table Names/OUTPUT Tablename Keywords . . . . 2342 Using Auxiliary Variables to Subset Output Data Sets . . . . . . . . . . . . 2345 ODS Graphics . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 2346 Special Data Sets . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 2347 Examples: X12 Procedure . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 2352 2296 ✦ Chapter 34: The X12 Procedure Example 34.1: ARIMA Model Identification . . . . . . . . . . . . . . . . . 2352 Example 34.2: Model Estimation . . . . . . . . . . . . . . . . . . . . . . . 2356 Example 34.3: Seasonal Adjustment . . . . . . . . . . . . . . . . . . . . . 2358 Example 34.4: RegARIMA Automatic Model Selection . . . . . . . . . . . . 2361 Example 34.5: Automatic Outlier Detection . . . . . . . . . . . . . . . . . . 2367 Example 34.6: User-Defined Regressors . . . . . . . . . . . . . . . . . . . 2373 Example 34.7: MDLINFOIN= and MDLINFOOUT= Data Sets . . . . . . . 2375 Example 34.8: Setting Regression Parameters . . . . . . . . . . . . . . . . 2382 Example 34.9: Illustration of ODS Graphics . . . . . . . . . . . . . . . . . 2390 Example 34.10: AUXDATA= Data Set . . . . . . . . . . . . . . . . . . . . . 2391 Acknowledgments: X12 Procedure . . . . . . . . . . . . . . . . . . . . . . . . . . 2393 References . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 2393 Overview: X12 Procedure The X12 procedure, an adaptation of the U.S. Bureau of the Census X-12-ARIMA Seasonal Ad- justment program (U.S. Bureau of the Census 2001c), seasonally adjusts monthly or quarterly time series. The procedure makes additive or multiplicative adjustments and creates an output data set that contains the adjusted time series and intermediate calculations. The X-12-ARIMA program combines the capabilities of the X-11 program (Shiskin, Young, and Musgrave 1967) and the X-11-ARIMA/88 program (Dagum 1988) and also introduces some new features (Findley et al. 1998). One of the main enhancements involves the use of a regARIMA model, a regression model with ARIMA (autoregressive integrated moving average) errors. Thus, the X-12-ARIMA program contains methods developed by both the U.S. Census Bureau and Statistics Canada. In addition, the X-12-ARIMA automatic modeling routine is based on the TRAMO (time series regression with ARIMA noise, missing values, and outliers) method (Gomez and Maravall 1997a, b). The four major components of the X-12-ARIMA program are regARIMA modeling, model diagnostics, seasonal adjustment that uses enhanced X-11 methodology, and post-adjustment diagnostics. Statistics Canada’s X-11 method fits an ARIMA model to the original series, and then uses the model forecasts to extend the original series. This extended series is then seasonally adjusted by the standard X-11 seasonal adjustment method. The extension of the series improves the estimation of the seasonal factors and reduces revisions to the seasonally adjusted series as new data become available. Seasonal adjustment of a series is based on the assumption that seasonal fluctuations can be measured in the original series, O t , t D 1; . , n , and separated from trend cycle, trading day, and irregular fluctuations. The seasonal component of this time series, S t , is defined as the intrayear variation that is repeated consistently or in an evolving fashion from year to year. The trend cycle component, C t , includes variation due to the long-term trend, the business cycle, and other long-term cyclical factors. The trading day component, D t , is the variation that can be attributed to the composition of the calendar. The irregular component, I t , is the residual variation. Many economic time series are related in a multiplicative fashion ( O t D S t C t D t I t ). Other economic series are related in an additive Getting Started: X12 Procedure ✦ 2297 fashion ( O t D S t C C t C D t C I t ). A seasonally adjusted time series, C t I t or C t C I t , consists of only the trend cycle and irregular components. For more details about seasonal adjustment with the X-11 method, see Ladiray and Quenneville (2001). Graphics are now available with the X12 procedure. For more information, see the section “ODS Graphics” on page 2346. Getting Started: X12 Procedure The most common use of the X12 procedure is to produce a seasonally adjusted series. Eliminating the seasonal component from an economic series facilitates comparison among consecutive months or quarters. A plot of the seasonally adjusted series is often more informative about trends or location in a business cycle than a plot of the unadjusted series. The following example shows how to use PROC X12 to produce a seasonally adjusted series, C t I t , from an original series O t D S t C t D t I t . In the multiplicative model, the trend cycle component C t keeps the same scale as the original series O t , while S t , D t , and I t vary around 1.0. In all displayed tables, these latter components are expressed as percentages and thus vary around 100.0 (in the additive case, they vary around 0.0). However, in the output data set, the data displayed as percentages in the displayed output are expressed as the decimal equivalent and thus vary around 1.0 in the multiplicative case. The naming convention used in PROC X12 for the tables follows the convention used in the Census Bureau’s X-12-ARIMA program; see X-12-ARIMA Reference Manual (U.S. Bureau of the Census 2001b) and X-12-ARIMA Quick Reference for UNIX (U.S. Bureau of the Census 2001a). Also see the section “Displayed Output/ODS Table Names/OUTPUT Tablename Keywords” on page 2342. The table names are outlined in Table 34.9. The tables that correspond to parts A through C are intermediate calculations. The final estimates of the individual components are found in the D tables: Table D10 contains the final seasonal factors, Table D12 contains the final trend cycle, and Table D13 contains the final irregular series. If you are primarily interested in seasonally adjusting a series without consideration of intermediate calculations or diagnostics, you need to look only at Table D11, the final seasonally adjusted series. Tables in part E contain information about extreme values and changes in the original and seasonally adjusted series. The tables in part F are seasonal adjustment quality measures. Spectral analysis is performed in part G. For further information about the tables produced by the X11 statement, see Ladiray and Quenneville (2001). 2298 ✦ Chapter 34: The X12 Procedure Basic Seasonal Adjustment 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 X12 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 x12 data=sales date=date; var sales; x11; ods select d11; run; Basic Seasonal Adjustment ✦ 2299 The results of the seasonal adjustment are in table D11 (the final seasonally adjusted series) in the displayed output shown in Figure 34.1. Figure 34.1 Basic Seasonal Adjustment The X12 Procedure Table D 11: Final Seasonally Adjusted Data For Variable sales Year JAN FEB MAR APR MAY JUN JUL AUG SEP OCT NOV DEC Total 1978 . . . . . . . . 124.560 124.649 124.920 129.002 503.131 1979 125.087 126.759 125.252 126.415 127.012 130.041 128.056 129.165 127.182 133.847 133.199 135.847 1547.86 1980 128.767 139.839 143.883 144.576 148.048 145.170 140.021 153.322 159.128 161.614 167.996 165.388 1797.75 1981 175.984 166.805 168.380 167.913 173.429 175.711 179.012 182.017 186.737 197.367 183.443 184.907 2141.71 1982 186.080 203.099 193.386 201.988 198.322 205.983 210.898 213.516 213.897 218.902 227.172 240.453 2513.69 1983 231.839 224.165 219.411 225.907 225.015 226.535 221.680 222.177 222.959 212.531 230.552 232.565 2695.33 1984 237.477 239.870 246.835 242.642 244.982 246.732 251.023 254.210 264.670 266.120 266.217 276.251 3037.03 1985 275.485 281.826 294.144 286.114 293.192 296.601 293.861 309.102 311.275 319.239 319.936 323.663 3604.44 1986 326.693 330.341 330.383 330.792 333.037 332.134 336.444 341.017 346.256 350.609 361.283 362.519 4081.51 1987 364.951 371.274 369.238 377.242 379.413 376.451 378.930 375.392 374.940 373.612 368.753 364.885 4475.08 1988 371.618 383.842 385.849 404.810 381.270 388.689 385.661 377.706 397.438 404.247 414.084 416.486 4711.70 1989 426.716 419.491 427.869 446.161 438.317 440.639 450.193 454.638 460.644 463.209 427.728 485.386 5340.99 1990 477.259 477.753 483.841 483.056 481.902 499.200 484.893 485.245 . . . . 3873.15 Avg 277.330 280.422 282.373 286.468 285.328 288.657 288.389 291.459 265.807 268.829 268.774 276.446 Total: 40323 Mean: 280.02 S.D.: 111.31 Min: 124.56 Max: 499.2 2300 ✦ Chapter 34: The X12 Procedure You can compare the original series (Table A1) and the final seasonally adjusted series (Table D11) by plotting them together as shown in Figure 34.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 x12 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 34.2 Plot of Original and Seasonally Adjusted Data Syntax: X12 Procedure ✦ 2301 Syntax: X12 Procedure The X12 procedure uses the following statements: PROC X12 options ; VAR variables ; BY variables ; ID variables ; EVENT variables ; USERDEFINED variables ; TRANSFORM options ; ADJUST options ; IDENTIFY options ; AUTOMDL options ; OUTLIER options ; REGRESSION options ; INPUT variables ; ARIMA options ; ESTIMATE options ; X11 options ; FORECAST options ; CHECK options ; OUTPUT options ; TABLES options ; The PROC X12 statements perform basically the same function as the Census Bureau’s X-12-ARIMA specs. Specs (specifications) are used in X-12-ARIMA to control the computations and output. The PROC X12 statement performs some of the same functions as the Series spec in the Census Bureau’s X-12-ARIMA software. The ADJUST statement performs some of the same functions as the Transform spec. The TRANSFORM, IDENTIFY, AUTOMDL, OUTLIER, REGRESSION, ARIMA, ESTIMATE, X11, FORECAST, and CHECK statements are designed to perform the same functions as the corresponding X-12-ARIMA specs, although full compatibility is not yet available. The Census Bureau documentation X-12-ARIMA Reference Manual (U.S. Bureau of the Census 2001b) can provide added insight to the functionality of these statements. . 201 .98 8 198 . 322 205 .98 3 210. 898 213.516 213. 897 218 .90 2 227 .172 240.453 2513. 69 198 3 231. 8 39 224 .165 2 19. 411 225 .90 7 225 .015 226 .535 221 .680 222 .177 222 .95 9 212.531 230.552 232.565 2 695 .33 198 4 237.477. 153. 322 1 59. 128 161.614 167 .99 6 165.388 1 797 .75 198 1 175 .98 4 166.805 168.380 167 .91 3 173.4 29 175.711 1 79. 012 182.017 186.737 197 .367 183.443 184 .90 7 2141.71 198 2 186.080 203. 099 193 .386 201 .98 8 198 . 322. 463.2 09 427.728 485.386 5340 .99 199 0 477.2 59 477.753 483.841 483.056 481 .90 2 499 .200 484. 893 485.245 . . . . 3873.15 Avg 277.330 280. 422 282.373 286.468 285.328 288.657 288.3 89 291 .4 59 265.807