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!
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;
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?
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;
Are you ready for the spotlight? We're accepting content ideas for SAS Innovate 2025 to be held May 6-9 in Orlando, FL. The call is open until September 25. Read more here about why you should contribute and what is in it for you!
ANOVA, or Analysis Of Variance, is used to compare the averages or means of two or more populations to better understand how they differ. Watch this tutorial for more.
Find more tutorials on the SAS Users YouTube channel.