X13 Procedure

Example 45.8 Setting Regression Parameters

(View the complete code for this example.)

This example illustrates the use of fixed regression parameters in PROC X13. Suppose that you have the same data set as in the section Basic Seasonal Adjustment. You can specify the following statements to use TRAMO to automatically identify a model that includes a US Census Bureau Easter(25) regressor:

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

The displayed results are shown in Output 45.8.1.

Output 45.8.1: Automatic Model ID with Easter(25) Regression

Estimate Easter(25) Parameter

The X13 Procedure

Regression Model Parameter Estimates
For Variable sales
TypeParameterNoEstEstimateStandard
Error
t ValuePr > |t|
EasterEaster[25]Est-5.092983.50786-1.450.1489

Exact ARMA Maximum Likelihood Estimation
For Variable sales
ParameterLagEstimateStandard
Error
t ValuePr > |t|
Nonseasonal AR10.621480.092796.70<.0001
 20.233540.103852.250.0262
 3-0.071910.09055-0.790.4285
Nonseasonal MA10.973770.0377125.82<.0001
Seasonal MA120.105580.102051.030.3028


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

proc print data=mdlout1;
run;

Output 45.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_
1salesREGPREDEFINEDSCALEEASTEREASTER25...0-5.092983.50786-1.45190.14894.  
2salesARIMAFORECASTNONSEASONALDIFsales..1.......  
3salesARIMAFORECASTSEASONALDIFsales..1.......  
4salesARIMAFORECASTNONSEASONALARsales.11.00.621480.092796.69800.00000.  
5salesARIMAFORECASTNONSEASONALARsales.12.00.233540.103852.24880.02621.  
6salesARIMAFORECASTNONSEASONALARsales.13.0-0.071910.09055-0.79420.42851.  
7salesARIMAFORECASTNONSEASONALMAsales.11.00.973770.0377125.82400.00000.  
8salesARIMAFORECASTSEASONALMAsales.21.00.105580.102051.03460.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 MDLINFOIN= 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 45.8.3.

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

Output 45.8.3: Automatic Model ID with Fixed Easter(25) and Saturday Regression

Use SAS Statements to Alter Model

The X13 Procedure

Regression Model Parameter Estimates
For Variable sales
TypeParameterNoEstEstimateStandard
Error
t ValuePr > |t|
User DefinedSaturdayEst3.232251.167012.770.0064
EasterEaster[25]Fixed-5.02930...

Exact ARMA Maximum Likelihood Estimation
For Variable sales
ParameterLagEstimateStandard
Error
t ValuePr > |t|
Nonseasonal AR1-0.325060.08256-3.940.0001


To fix the EASTER regressor and add the new SATURDAY regressor by using a DATA step, you can create the data set mdlin2 as shown. The data set mdlin2 is displayed in Output 45.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 45.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_
1salesREGPREDEFINEDSCALEEASTEREASTER25...1-5.029303.50786-1.45190.14894.  
2salesARIMAFORECASTNONSEASONALDIFsales..1.......  
3salesARIMAFORECASTSEASONALDIFsales..1.......  
4salesARIMAFORECASTNONSEASONALARsales.11.00.621480.092796.69800.00000.  
5salesARIMAFORECASTNONSEASONALARsales.12.00.233540.103852.24880.02621.  
6salesARIMAFORECASTNONSEASONALARsales.13.0-0.071910.09055-0.79420.42851.  
7salesARIMAFORECASTNONSEASONALMAsales.11.00.973770.0377125.82400.00000.  
8salesARIMAFORECASTSEASONALMAsales.21.00.105580.102051.03460.30277.  
9salesREGEVENTSCALEUSERSATURDAY..........  


The data set mdlin2 can be used to replace the regression and model information contained in the REGRESSION, 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 45.8.5:

title 'Alter the Model by Updating the MdlInfoIn= Data Set';
proc x13 data=sales date=date MdlInfoIn=mdlin2 MdlInfoOut=mdlout2DS;
   var sales;
   estimate;
run ;

Output 45.8.5: Estimate MDLINFOIN= File for Model with Fixed Easter(25) and Saturday Regression, Previously Identified Model

Alter the Model by Updating the MdlInfoIn= Data Set

The X13 Procedure

Regression Model Parameter Estimates
For Variable sales
TypeParameterNoEstEstimateStandard
Error
t ValuePr > |t|
User DefinedSATURDAYEst3.417621.076413.180.0019
EasterEaster[25]Fixed-5.02930...

Exact ARMA Maximum Likelihood Estimation
For Variable sales
ParameterLagEstimateStandard
Error
t ValuePr > |t|
Nonseasonal AR10.622250.091756.78<.0001
 20.304290.101093.010.0031
 3-0.148620.08859-1.680.0958
Nonseasonal MA10.971250.0379825.57<.0001
Seasonal MA120.116910.100001.170.2445


The following statements specify almost the same information as contained in the data set mdlin2. The ARIMA statement specifies 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 45.8.6.

title 'Use SAS Statements to Alter Model';
proc x13 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 45.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_
1salesREGEVENTSCALEUSERSaturday....03.417601.076403.17500.00187.  
2salesREGPREDEFINEDSCALEEASTEREASTER25...1-5.02930....  
3salesARIMAFORECASTNONSEASONALDIFsales..1.......  
4salesARIMAFORECASTSEASONALDIFsales..1.......  
5salesARIMAFORECASTNONSEASONALARsales.11.00.622280.091756.78250.00000.  
6salesARIMAFORECASTNONSEASONALARsales.12.00.304310.101093.01030.00314.  
7salesARIMAFORECASTNONSEASONALARsales.13.0-0.148640.08859-1.67790.09578.  
8salesARIMAFORECASTNONSEASONALMAsales.11.00.971280.0379625.58820.00000.  
9salesARIMAFORECASTSEASONALMAsales.21.00.116840.100001.16840.24481.  


The MDLINFOOUT= data set provides a method for comparing the results of the model identification. The data set mdlout3grm that results from using the MODEL= option in the ARIMA statement can be compared to the data set mdlout2DS that results from using the MDLINFOIN= data set with initial values for the AR and MA parameters. The mdlout2DS data set is shown in Output 45.8.7, and the results of the comparison are shown in Output 45.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.

title 'Model Produced by Updating the MdlInfoIn= Data Set';
proc print data=mdlout2DS;
run;

Output 45.8.7: MDLINFOOUT= Data Set, Fixed Easter(25) and Added Saturday Regression, Previously Identified Model

Model Produced by Updating the MdlInfoIn= Data Set

Obs_NAME__MODELTYPE__MODELPART__COMPONENT__PARMTYPE__DSVAR__VALUE__FACTOR__LAG__SHIFT__NOEST__EST__STDERR__TVALUE__PVALUE__STATUS__SCORE__LABEL_
1salesREGEVENTSCALEUSERSATURDAY....03.417621.076413.17500.00187.  
2salesREGPREDEFINEDSCALEEASTEREASTER25...1-5.02930....  
3salesARIMAFORECASTNONSEASONALDIFsales..1.......  
4salesARIMAFORECASTSEASONALDIFsales..1.......  
5salesARIMAFORECASTNONSEASONALARsales.11.00.622250.091756.78170.00000.  
6salesARIMAFORECASTNONSEASONALARsales.12.00.304290.101093.01000.00314.  
7salesARIMAFORECASTNONSEASONALARsales.13.0-0.148620.08859-1.67760.09584.  
8salesARIMAFORECASTNONSEASONALMAsales.11.00.971250.0379825.57120.00000.  
9salesARIMAFORECASTSEASONALMAsales.21.00.116910.100001.16910.24451.  


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

Output 45.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.0000227   0.000665            
                   5  ||     0.6223     0.6222  -0.000033  -0.005259            
                   6  ||     0.3043     0.3043  -0.000021  -0.006983            
                   7  ||    -0.1486    -0.1486  0.0000236    -0.0159            
                   8  ||     0.9713     0.9713  -0.000024  -0.002459            
                   9  ||     0.1168     0.1169  0.0000763     0.0653            
           __________________________________________________________           


Last updated: June 19, 2025