X11 Instruction |
X11( options ) series start end
X11 performs a seasonal adjustment on a series using the Census X11 method, as revised for the Census Bureau's X13-ARIMA-SEATS program. The X11 instruction is only available in the Professional version of RATS—the command will have no effect in the standard versions. Please contact Estima if you are interested in upgrading to the Professional version.
Wizard
Use the Data/Graphics—X11 wizard.
Parameters
series |
series to be seasonally adjusted. |
start, end |
range to use in seasonal adjustment. By default, range of series. |
Overview
X11 can only be applied to monthly or quarterly series containing at least three years of data. Note that the X11 method will not necessarily work well with some types of series:
•It assumes that the seasonal component changes, if at all, in a fairly smooth fashion.
•It assumes that the seasonality is primarily a function of the calendar.
If, instead, the series shows a fairly sharp break in its seasonal pattern, or if the seasonal is more a function of some other variable (e.g. weather-driven electric demand), X11 is likely to leave some obvious seasonality in all, or at least part, of the data. One simple way to check how well X11 is doing on a new series is to run it first on the first 3/4 of the data, then on the last 3/4. Compare the overlapping range.
Options
MODE=[MULTIPLICATIVE]/ADDITIVE/PSEUDOADDITIVE/LOGADDITIVE
MULTIPLICATIVE/[NOMULT](for compatibility with older versions of RATS)
The MODE option chooses which of the four adjustment modes to use. The older MULTIPLICATIVE option still works, but we would recommend correcting any of your programs to use the new option.
ADJUSTED=(output) series for the seasonal adjusted data
FACTORS=(output) series for the seasonal factors
Use these if you want to save the seasonally adjusted series and/or the series of seasonal factors computed by X11. The seasonal factors include forecasts for three years beyond the adjustment period.
[GRADUATE]/NOGRADUATE
LOWER=lower limit standard errors from the mean [1.5]
UPPER=upper limit standard errors from the mean [2.5]
Graduating extremes reduces the effect of outliers on the estimates of the seasonal factors. This only makes a great deal of difference if a series has a good deal of non-seasonal variability. Essentially, this drops data points which are more than “Upper Limit” standard errors from the mean (within a certain calculation), leaves unchanged those closer to the mean than “Lower Limit” standard errors and makes a smooth transition from inclusion to exclusion for those in between.
PREFACTORS=(input) preliminary adjustment factors [not used]
X13-ARIMA emphasizes the use of preliminary adjustment factors to take care of various type of outliers, rather than using the internal outlier detection engine (which is still present). These are usually estimated using the BOXJENK instruction, and created using the ADJUST option on it.
For multiplicative and log-additive adjustments, these should be in the form of factors, that is, 1.0 means no adjustment. If you are doing a log-additive adjustment starting with a BOXJENK model applied to the log of the series, you will have to transform the factors generated by BOXJENK from their additive form to the multiplicative form.
EXTENSION=(input) series with out-of-sample forecasts of the input series
LEADS=number of periods of extension
The EXTENSION series is used in computing some of centered moving averages within the X11 engine to reduce the bias in the end effects on the filters.
PRINT=[NONE]/SHORT/STANDARD/LONG/FULL
DECIMALS=number of decimals to show in output [depends upon data]
PRINT controls the amount of output displayed by the X11 instruction:
NONE |
This produces no output—used for production runs where you don’t need to examine the output. |
SHORT |
This choice produces the minimum amount of printed output—only the initial series and final component estimates. |
STANDARD |
This is the standard level of X11 output—still primarily the final estimates. |
LONG |
This setting includes most of the important intermediate steps in addition to the standard output. |
FULL |
This reports on every step in the main adjustment process. |
DECIMALS controls the number of digits right of the decimal to display in any of the output. This has no effect on the level of precision of the calculations or the output series, just the printed output. By default, this depends upon the data.
Internal Regression Effects
These options control an internal regression of the irregular component on various dummy variables.
TRADEDAY=[NONE]/APPLY
This allows you to apply a “trading day adjustment” for variation due to the number of Mondays, Tuesdays, etc., in a month. A typical series which would benefit from trading day adjustment is a total retail sales series, where there would be considerable predictable variation among the days of the week.
NONE |
The trading day option is not applied. |
APPLY |
Computes trading day factors, applies them to final adjustment. |
Before RATS 7.1, the following holidays were switch options. These are still supported, though it’s recommended that any of these be done as preliminary factors instead. All of the holiday shifts are adjusted for long-run mean values, which prevents them from picking up a spurious trend effect for particular ranges of data.
EASTER=number of days before Easter at which effect is felt [not used]
It’s assumed that the level of activity is different for this number of days before Easter. This generates a dummy which splits this among February, March and April based upon the number of days falling in each month. The analogue to the old EASTER switch option (for versions before 7.2) is EASTER=21, though the calculation is now done differently.
LABORDAY=number of days before Labor Day for the effect [not used]
It’s assumed that the level of activity is different for this number of days prior to Labor Day. This generates a dummy which splits this between August and September based upon the number of days falling in each month. The value for this that’s equivalent to the old LABORDAY switch is LABORDAY=8.
THANKSGIVING=number of days before Thanksgiving for the effect [not used]
The value which gives the old adjustment is –1, that is the day after Thanksgiving. The level of activity is assumed to be different from this point to December 24.
CRITICAL=critical value (t-stat) for outlier detection[depends upon number of data points, typically around 3.8]
The internal regression used for the four options above includes automatic detection and removal of additive outliers. This is to prevent contamination of the estimates of the calendar effects by very large outliers. Data points for which an additive dummy has a t-statistic bigger than the indicated limit are removed from the regression. These are added sequentially using a forward pass and possibly deleted using a backwards one.
Examples
This seasonally adjusts DEUIP (German Industrial Production) by applying the multiplicative decomposition. The adjusted series and the seasonal factors are saved into DEUADJIP and DEUFACT, respectively.
calendar(m) 1961:12
allocate 1988:1
open data examx11.rat
data(format=rats) / deuip
x11(mode=mult,adjusted=deuadjip,factors=deufact) deuip
This uses the @GMAUTOFIT procedure to automatically select a model for the log of the data, and then estimates the selected model using BOXJENK, with automatic detection of outliers. The adjustment series needs to be anti-logged before it can be used as a preliminary set of factors. The value of FINAL at the end of the data is subtracted before the exp is taken so the adjustment will leave the end of data value at its observed level. This is done because the level shift and temporary change dummies are defined from t0 on, and so will give non-zero shift values to the end of the data, rather than the beginning. (The adjusted data will be the same either way; any printed output looks more natural with this correction). The series is adjusted using the log-additive model, with a full set of printed output.
set ldata = log(u36cvs)
@gmautofit(report,diffs=1) ldata
boxjenk(ar=%%autop,diffs=1,ma=%%autoq,sar=%%autops,$
sdiffs=1,sma=%%autoqs,method=bfgs,outliers=standard,$
adjustments=final) ldata
set prior = exp(final-final(2008:7))
x11(mode=logadd,prefactors=prior,print=full) u36cvs
Technical Information
For technical details, please see the RATS X11 Manual Supplement PDF file (included with the Professional version of RATS).
Copyright © 2025 Thomas A. Doan