BookmarkSubscribeRSS Feed
Lok07
Calcite | Level 5

Dear community

I have a monthly time serire data and i want test the stationarity of this serie.

Can one give me any suggestion!!

regards 

4 REPLIES 4
imvash
SAS Employee

If you use SAS Viya, you can use TSA.STATIONARITYTEST function. See the example below (I copied from documentation), which uses sashelp.air data set in CAS:

 

proc tsmodel data=mycas.air outscalar=mycas.outscalars;
   id date interval=month;
   var air;
   outscalars stationary1 stationary2;
   require tsa;
   submit;
   declare object TSA(tsa);
   stationary1=1; stationary2=1;
   rc = TSA.STATIONARITYTEST(air,,,,,pvalue);
   *test with the default significant level=0.05;
   if rc =1 then stationary1 = 0;
   *test with significant level = 0.1;
   if pvalue > 0.1 then stationary2 = 0;
   endsubmit;
run;
You can get more information regarding the TSA package and this function at
 
 
Hope it helps!
Lok07
Calcite | Level 5

Hi 

I don't use SAS viya.

I used the ADF and KPSS test.

Based on their output the time serie has a trend.

But when i want remove the trend using proc reg

Proc reg data=database;

     model y= T;

run;

T is the date variable from Jan 2015 to Dec 2018.

data database;

set database;

T

TY= y-B*T;

run;

The TY which i created has no value.

I don't know how i can remove the trend of my variable.

 

noetsi
Obsidian | Level 7
There are two types of non-Stationarity. The first is stochastic non-Stationarity (which I think is what one uses the ADF and KPSS test for). This is dealt with by differencing.

The second type is a deterministic non-Stationarity. This is commonly dealt with by specifying a quadratic or cubic time variable.

You have to know which type of non-Stationarity you have and specify the right correction.
Lok07
Calcite | Level 5

Hi noetsi 

I have  a deterministic non-Stationarity.

Should I regress my variable on the date (date is from Jan 2015 to Dec 2018) variable like that 

proc reg data=data;

model Y=date;

run;

SAS Innovate 2025: Call for Content

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!

Submit your idea!

Multiple Linear Regression in SAS

Learn how to run multiple linear regression models with and without interactions, presented by SAS user Alex Chaplin.

Find more tutorials on the SAS Users YouTube channel.

Discussion stats
  • 4 replies
  • 1302 views
  • 0 likes
  • 3 in conversation