The X12 Procedure

## Example 32.8 Setting Regression Parameters

This example illustrates the use of fixed regression parameters in PROC X12. Suppose that you have the same data set as in the section Basic Seasonal Adjustment. You would like to use TRAMO to automatically identify a model with an U.S. Census Bureau Easter(25) regression. The displayed results are shown in Output 32.8.1.

```   title 'Estimate Easter(25) Parameter';
proc x12 data=sales date=date MdlInfoOut=mdlout1;
var sales;
regression predefined=easter(25);
automdl;
run ;
```

Output 32.8.1 Automatic Model ID with Easter(25) Regression
 Estimate Easter(25) Parameter

The X12 Procedure

Regression Model Parameter Estimates
For variable sales
Type Parameter NoEst Estimate Standard Error t Value Pr > |t|
Easter Easter[25] Est -5.09298 3.50786 -1.45 0.1489

Exact ARMA Maximum Likelihood Estimation
For variable sales
Parameter Lag Estimate Standard Error t Value Pr > |t|
Nonseasonal AR 1 0.62148 0.09279 6.70 <.0001
2 0.23354 0.10385 2.25 0.0262
3 -0.07191 0.09055 -0.79 0.4285
Nonseasonal MA 1 0.97377 0.03771 25.82 <.0001
Seasonal MA 12 0.10558 0.10205 1.03 0.3028

The MDLINFOOUT= data set, mdlout1, that contains the model and parameter estimates is shown in Output 32.8.2.

```   proc print data=mdlout1;
run;
```

Output 32.8.2 MDLINFOOUT= Data Set, Estimation of Automatic Model ID with Easter(25) Regression
 Estimate Easter(25) Parameter

Obs _NAME_ _MODELTYPE_ _MODELPART_ _COMPONENT_ _PARMTYPE_ _DSVAR_ _VALUE_ _FACTOR_ _LAG_ _SHIFT_ _NOEST_ _EST_ _STDERR_ _TVALUE_ _PVALUE_ _STATUS_ _SCORE_ _LABEL_
1 sales REG PREDEFINED SCALE EASTER EASTER 25 . . . 0 -5.09298 3.50786 -1.4519 0.14894 .
2 sales ARIMA FORECAST NONSEASONAL DIF sales . . 1 . . . . . . .
3 sales ARIMA FORECAST SEASONAL DIF sales . . 1 . . . . . . .
4 sales ARIMA FORECAST NONSEASONAL AR sales . 1 1 . 0 0.62148 0.09279 6.6980 0.00000 .
5 sales ARIMA FORECAST NONSEASONAL AR sales . 1 2 . 0 0.23354 0.10385 2.2488 0.02621 .
6 sales ARIMA FORECAST NONSEASONAL AR sales . 1 3 . 0 -0.07191 0.09055 -0.7942 0.42851 .
7 sales ARIMA FORECAST NONSEASONAL MA sales . 1 1 . 0 0.97377 0.03771 25.8240 0.00000 .
8 sales ARIMA FORECAST SEASONAL MA sales . 2 1 . 0 0.10558 0.10205 1.0346 0.30277 .

To fix the Easter(25) parameter while adding a regressor that is weighted according to the number of Saturdays in a month, either use the REGRESSION and EVENT statements or create a MDLINFOOUT= data set. The following statements show the method for using the REGRESSION statement to fix the EASTER parameter and the EVENT statement to add the SATURDAY regressor. The output is shown in Output 32.8.3.

```   title 'Use SAS Statements to Alter Model';
proc x12 data=sales date=date MdlInfoOut=mdlout2grm;
var sales;
regression predefined=easter(25) / b=-5.029298 F;
event Saturday;
automdl;
run ;
```

Output 32.8.3 Automatic Model ID with Fixed Easter(25) and Saturday Regression
 Use SAS Statements to Alter Model

The X12 Procedure

Regression Model Parameter Estimates
For variable sales
Type Parameter NoEst Estimate Standard Error t Value Pr > |t|
User Defined Saturday Est 3.23225 1.16701 2.77 0.0064
Easter Easter[25] Fixed -5.02930 . . .

Exact ARMA Maximum Likelihood Estimation
For variable sales
Parameter Lag Estimate Standard Error t Value Pr > |t|
Nonseasonal AR 1 -0.32506 0.08256 -3.94 0.0001

To fix the EASTER regressor and add the new SATURDAY regressor by using a DATA step, you would create the data set mdlin2 as shown. The data set mdlin2 is displayed in Output 32.8.4.

```   title 'Use a SAS DATA Step to Create a MdlInfoIn= Data Set';
data plusSaturday;
_NAME_ = 'sales';
_MODELTYPE_ = 'REG';
_MODELPART_ = 'EVENT';
_COMPONENT_ = 'SCALE';
_PARMTYPE_ = 'USER';
_DSVAR_ = 'SATURDAY';
run;

data mdlin2;
set mdlout1;
if ( _DSVAR_ = 'EASTER' ) then do;
_NOEST_ = 1;
_EST_ = -5.029298;
end;
run;

proc append base=mdlin2 data=plusSaturday force;
run;
```
```   proc print data=mdlin2;
run;
```

Output 32.8.4 MDLINFOIN= Data Set, Fixed Easter(25) and Added Saturday Regression, Previously Identified Model
 Use a SAS DATA Step to Create a MdlInfoIn= Data Set

Obs _NAME_ _MODELTYPE_ _MODELPART_ _COMPONENT_ _PARMTYPE_ _DSVAR_ _VALUE_ _FACTOR_ _LAG_ _SHIFT_ _NOEST_ _EST_ _STDERR_ _TVALUE_ _PVALUE_ _STATUS_ _SCORE_ _LABEL_
1 sales REG PREDEFINED SCALE EASTER EASTER 25 . . . 1 -5.02930 3.50786 -1.4519 0.14894 .
2 sales ARIMA FORECAST NONSEASONAL DIF sales . . 1 . . . . . . .
3 sales ARIMA FORECAST SEASONAL DIF sales . . 1 . . . . . . .
4 sales ARIMA FORECAST NONSEASONAL AR sales . 1 1 . 0 0.62148 0.09279 6.6980 0.00000 .
5 sales ARIMA FORECAST NONSEASONAL AR sales . 1 2 . 0 0.23354 0.10385 2.2488 0.02621 .
6 sales ARIMA FORECAST NONSEASONAL AR sales . 1 3 . 0 -0.07191 0.09055 -0.7942 0.42851 .
7 sales ARIMA FORECAST NONSEASONAL MA sales . 1 1 . 0 0.97377 0.03771 25.8240 0.00000 .
8 sales ARIMA FORECAST SEASONAL MA sales . 2 1 . 0 0.10558 0.10205 1.0346 0.30277 .
9 sales REG EVENT SCALE USER SATURDAY . . . . . . . . . .

The data set mdlin2 can be used to replace the regression and model information contained in the REGRSSION, EVENT, and AUTOMDL statements. Note that the model specified in the mdlin2 data set is the same model as the automatically identified model. The following example uses the mdlin2 data set as input; the results are displayed in Output 32.8.5.

```   title 'Use Updated Data Set to Alter Model';
proc x12 data=sales date=date MdlInfoIn=mdlin2 MdlInfoOut=mdlout2DS;
var sales;
estimate;
run ;
```

Output 32.8.5 Estimate MDLINFOIN= File for Model with Fixed Easter(25) and Saturday Regression, Previously Identified Model
 Use Updated Data Set to Alter Model

The X12 Procedure

Regression Model Parameter Estimates
For variable sales
Type Parameter NoEst Estimate Standard Error t Value Pr > |t|
User Defined SATURDAY Est 3.41762 1.07641 3.18 0.0019
Easter Easter[25] Fixed -5.02930 . . .

Exact ARMA Maximum Likelihood Estimation
For variable sales
Parameter Lag Estimate Standard Error t Value Pr > |t|
Nonseasonal AR 1 0.62225 0.09175 6.78 <.0001
2 0.30429 0.10109 3.01 0.0031
3 -0.14862 0.08859 -1.68 0.0958
Nonseasonal MA 1 0.97125 0.03798 25.57 <.0001
Seasonal MA 12 0.11691 0.10000 1.17 0.2445

The following statements specify almost the same information as contained in the data set mdlin2. Note that the ARIMA statement is used to specify the lags of the model. However, the initial AR and MA parameter values are the default. When using the mdlin2 data set as input, the initial values can be specified. The results are displayed in Output 32.8.6.

```   title 'Use SAS Statements to Alter Model';
proc x12 data=sales date=date MdlInfoOut=mdlout3grm;
var sales;
regression predefined=easter(25) / b=-5.029298 F;
event Saturday;
arima model=((3 1 1)(0 1 1));
estimate;
run ;
```
```   proc print data=mdlout3grm;
run;
```

Output 32.8.6 MDLINFOOUT= Statement, Fixed Easter(25) and Added Saturday Regression, Previously Identified Model
 Use SAS Statements to Alter Model

Obs _NAME_ _MODELTYPE_ _MODELPART_ _COMPONENT_ _PARMTYPE_ _DSVAR_ _VALUE_ _FACTOR_ _LAG_ _SHIFT_ _NOEST_ _EST_ _STDERR_ _TVALUE_ _PVALUE_ _STATUS_ _SCORE_ _LABEL_
1 sales REG EVENT SCALE USER Saturday . . . . 0 3.41760 1.07640 3.1750 0.00187 .
2 sales REG PREDEFINED SCALE EASTER EASTER 25 . . . 1 -5.02930 . . . .
3 sales ARIMA FORECAST NONSEASONAL DIF sales . . 1 . . . . . . .
4 sales ARIMA FORECAST SEASONAL DIF sales . . 1 . . . . . . .
5 sales ARIMA FORECAST NONSEASONAL AR sales . 1 1 . 0 0.62228 0.09175 6.7825 0.00000 .
6 sales ARIMA FORECAST NONSEASONAL AR sales . 1 2 . 0 0.30431 0.10109 3.0103 0.00314 .
7 sales ARIMA FORECAST NONSEASONAL AR sales . 1 3 . 0 -0.14864 0.08859 -1.6779 0.09579 .
8 sales ARIMA FORECAST NONSEASONAL MA sales . 1 1 . 0 0.97128 0.03796 25.5881 0.00000 .
9 sales ARIMA FORECAST SEASONAL MA sales . 2 1 . 0 0.11684 0.10000 1.1684 0.24481 .

The MDLINFOOUT= data set provides a method for comparing the results of the model identification. The data set mdlout3grm that is the result of using the ARIMA MODEL= option can be compared to the data set mdlout2DS that is the result of using the MDLINFOIN= data set with initial values for the AR and MA parameters. The mdlout2DS data set is shown in Output 32.8.7, and the results of the comparison are shown in Output 32.8.8. The slight difference in the estimated parameters can be attributed to the difference in the initial values for the AR and MA parameters.

```   proc print data=mdlout2DS;
run;
```

Output 32.8.7 MDLINFOOUT= Data Set, Fixed Easter(25) and Added Saturday Regression, Previously Identified Model
 Use SAS Statements to Alter Model

Obs _NAME_ _MODELTYPE_ _MODELPART_ _COMPONENT_ _PARMTYPE_ _DSVAR_ _VALUE_ _FACTOR_ _LAG_ _SHIFT_ _NOEST_ _EST_ _STDERR_ _TVALUE_ _PVALUE_ _STATUS_ _SCORE_ _LABEL_
1 sales REG EVENT SCALE USER SATURDAY . . . . 0 3.41762 1.07641 3.1750 0.00187 .
2 sales REG PREDEFINED SCALE EASTER EASTER 25 . . . 1 -5.02930 . . . .
3 sales ARIMA FORECAST NONSEASONAL DIF sales . . 1 . . . . . . .
4 sales ARIMA FORECAST SEASONAL DIF sales . . 1 . . . . . . .
5 sales ARIMA FORECAST NONSEASONAL AR sales . 1 1 . 0 0.62225 0.09175 6.7817 0.00000 .
6 sales ARIMA FORECAST NONSEASONAL AR sales . 1 2 . 0 0.30429 0.10109 3.0100 0.00314 .
7 sales ARIMA FORECAST NONSEASONAL AR sales . 1 3 . 0 -0.14862 0.08859 -1.6776 0.09584 .
8 sales ARIMA FORECAST NONSEASONAL MA sales . 1 1 . 0 0.97125 0.03798 25.5712 0.00000 .
9 sales ARIMA FORECAST SEASONAL MA sales . 2 1 . 0 0.11691 0.10000 1.1691 0.24451 .

```   title 'Compare Results of SAS Statement Input and MdlInfoIn= Input';
proc compare base= mdlout3grm compare=mdlout2DS;
var _EST_;
run ;
```

Output 32.8.8 Compare Parameter Estimates from Different MDLINFOOUT= Data Sets
 Compare Results of SAS Statement Input and MdlInfoIn= Input

 ``` Value Comparison Results for Variables __________________________________________________________ || Value of Parameter Estimate || Base Compare Obs || _EST_ _EST_ Diff. % Diff ________ || _________ _________ _________ _________ || 1 || 3.4176 3.4176 0.0000225 0.000658 5 || 0.6223 0.6222 -0.000033 -0.005237 6 || 0.3043 0.3043 -0.000021 -0.006977 7 || -0.1486 -0.1486 0.0000235 -0.0158 8 || 0.9713 0.9713 -0.000024 -0.002452 9 || 0.1168 0.1169 0.0000759 0.0650 __________________________________________________________ ```

 Previous Page | Next Page | Top of Page