Programming the statistical procedures from SAS

PROC ARIMA, Differencing, and Indicator variables

Reply
Contributor
Posts: 41

PROC ARIMA, Differencing, and Indicator variables

Hi,

 

I have a general ARIMA question.

 

When creating an ARIMA model, if I take first differences, I also must take first differences of my covariates, correct? What if my covariate is an indicator variable, 0 or 1?  Does that variable get differenced?

 

Thank you!

Super Contributor
Posts: 339

Re: PROC ARIMA, Differencing, and Indicator variables

No, you can't difference a series that is already stationary. If you look at the IACF it is slowly decreasing:

 

Data A;
  Do i=1 To 100;
    u=IfN(Ranuni(1) gt 0.5,1,0);
	Output;
  End;
Run;

ODS Graphics On;
Proc Arima;
  Identify Var=u(1);
Run;
ODS Graphics Off;
Contributor
Posts: 41

Re: PROC ARIMA, Differencing, and Indicator variables

Thank you user24feb. 

 

So what happens to indicator variables when I difference the variable I'm forecasting?  Can they no longer be used in the model?  Or does it depend on the diagnostics?

 

Super Contributor
Posts: 339

Re: PROC ARIMA, Differencing, and Indicator variables

[ Edited ]

Sorry, I was wrong, you have to difference the dummy:

 

No, you can difference one series and leave another as it is.

 

What exactly is your indicator variable, an outlier like here:

 

Data A (Keep=x_i x t);
  Retain e1 0 x1 0 x2 0 x_i_1 100;  
  Do t=-100 To 10000;
    e=Rannor(0);
	x=(0.02+0.8*x1-0.4*e1+e);
	x_i=x_i_1+x;
	e1=e;
	x1=x;
	x_i_1=x_i;
	If t>0 Then Output;
  End;
Run;

Data A;
  Set A; 
  dummy=IfN(t>=6000 & t<=7500,1,0);
  x_i_d=x_i-dummy*200; * <- something bad happens;
Run;

ODS Graphics On;
Proc Timeseries Data=A Plot=Series;
  Var x_i_d x_i;
Run;
Proc Arima Data=A;
  Title "Model 1: Has dent";
  Identify Var=x_i_d (1) CrossCorr=dummy (1); * 1!!!!;
  Estimate p=1 q=1 Input=dummy Method=ML;
Run;
Proc Arima Data=A;
  Title "Model 2: No dent";
  Identify Var=x_i (1);
  Estimate p=1 q=1 Method=ML;
Run;
Title;
ODS Graphics Off;

 

Ask a Question
Discussion stats
  • 3 replies
  • 287 views
  • 0 likes
  • 2 in conversation