# The X12 Procedure

Assuming that the model in Example 37.2 is satisfactory, a seasonal adjustment that uses forecast extension can be performed by adding the X11 statement to the procedure. By default, the data is forecast one year ahead at the end of the series.

```ods output D8A#1=SalesD8A_1;
ods output D8A#2=SalesD8A_2;
ods output D8A#3=SalesD8A_3;
ods output D8A#4=SalesD8A_4;
proc x12 data=sales date=date;
var sales;
transform power=0;
arima model=( (0,1,1)(0,1,1) );
estimate;
x11;
run;
```
```title 'Stable Seasonality Test';
proc print data=SalesD8A_1 LABEL;
run;
```
```title 'Nonparametric Stable Seasonality Test';
proc print data=SalesD8A_2 LABEL;
run;
```
```title 'Moving Seasonality Test';
proc print data=SalesD8A_3 LABEL;
run;
```
```title 'Combined Seasonality Test';
proc print data=SalesD8A_4 LABEL NOOBS;
var _NAME_ Name1 Label1 cValue1;
run;
```

Table D8A, which contains the seasonality tests, is shown in Output 37.3.1.

Output 37.3.1: Table D8A as Displayed

The X12 Procedure

 Table D 8.A: F-tests for Seasonality For Variable sales

Test for the Presence of Seasonality Assuming Stability
Sum of Squares DF Mean Square F-Value
Between Months 23571.41 11 2142.855 190.9544 **
Residual 1481.28 132 11.22182
Total 25052.69 143

 ** Seasonality present at the 0.1 percent level.

Nonparametric Test for the
Presence of Seasonality Assuming
Stability
Kruskal-Wallis
Statistic
DF Probability
Level
131.9546 11 .00%

 Seasonality present at the one percent level.

Moving Seasonality Test
Sum of Squares DF Mean Square F-Value
Between Years 259.2517 10 25.92517 3.370317 **
Error 846.1424 110 7.692204

 **Moving seasonality present at the one percent level.

Summary of Results and Combined Test for the Presence of Identifiable Seasonality
Seasonality Tests: Probability Level

Stable Seasonality F-test 0.000
Moving Seasonality F-test 0.001
Kruskal-Wallis Chi-square Test 0.000

Combined Measures: Value

T1 = 7/F_Stable 0.04
T2 = 3*F_Moving/F_Stable 0.05
T = (T1 + T2)/2 0.04

Combined Test of Identifiable Seasonality: Present

The four ODS statements in the preceding example direct output from the D8A tables into four data sets: `SalesD8A_1`, `SalesD8A_2`, `SalesD8A_3`, and `SalesD8A_4`. It is best to direct the output to four different data sets because the four tables associated with Table D8A have varying formats. The ODS data sets are shown in Output 37.3.2, Output 37.3.3, Output 37.3.4, and Output 37.3.5.

Output 37.3.2: Table D8A Output in Data Set `SalesD8A_1`

 Stable Seasonality Test

Obs _NAME_ FT_SRC Sum of Squares DF Mean Square F-Value FT_AST
1 sales Between Months 23571.41 11 2142.855 190.9544 **
2 sales Residual 1481.28 132 11.22182 .
3 sales Total 25052.69 143 . .

Output 37.3.3: Table D8A Output in Data Set `SalesD8A_2`

 Nonparametric Stable Seasonality Test

Obs _NAME_ Kruskal-Wallis
Statistic
DF Probability
Level
1 sales 131.9546 11 .00%

Output 37.3.4: Table D8A Output in Data Set `SalesD8A_3`

 Moving Seasonality Test

Obs _NAME_ FT_SRC Sum of Squares DF Mean Square F-Value FT_AST
1 sales Between Years 259.2517 10 25.92517 3.370317 **
2 sales Error 846.1424 110 7.692204 .

Output 37.3.5: Table D8A Output in Data Set `SalesD8A_4`

 Combined Seasonality Test

_NAME_ Name1 Label1 cValue1
sales   Seasonality Tests: Probability Level
sales
sales P_STABLE Stable Seasonality F-test 0.000
sales P_MOV Moving Seasonality F-test 0.001
sales P_KW Kruskal-Wallis Chi-square Test 0.000
sales
sales   Combined Measures: Value
sales
sales T1 T1 = 7/F_Stable 0.04
sales T2 T2 = 3*F_Moving/F_Stable 0.05
sales T T = (T1 + T2)/2 0.04
sales
sales IDSeasTest Combined Test of Identifiable Seasonality: Present