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;
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;
T is the date variable from Jan 2015 to Dec 2018.
The TY which i created has no value.
I don't know how i can remove the trend of my variable.
Registration is open! SAS is returning to Vegas for an AI and analytics experience like no other! Whether you're an executive, manager, end user or SAS partner, SAS Innovate is designed for everyone on your team. Register for just $495 by 12/31/2023.
If you are interested in speaking, there is still time to submit a session idea. More details are posted on the website.
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.