BookmarkSubscribeRSS Feed
🔒 This topic is solved and locked. Need further help from the community? Please sign in and ask a new question.
Irene
Calcite | Level 5

I would like to use SAS FS to run an illustrating example in which the time variable is 1,2,3,4... Is there any way in the forecasting view the time-axis shows 1,2,3,4 rather than any strange years...

1 ACCEPTED SOLUTION

Accepted Solutions
udo_sas
SAS Employee

Hello -

Please note that  @PGStats's suggestion will only work if you use the SAS Forecast Server procedures.

From documentation:

Requirements for Time Series Data
To generate forecasts in SAS Forecast Studio, you need time series data. You might already have this time series data, or you might have transactional data. If you have transactional data, you can use the accumulation options in SAS Forecast Studio to convert the transactional data into a time series.
Your time series data must meet the following requirements:
The data set contains one variable for each dependent variable.
The data set contains a time ID variable that identifies the time period for each observation. When SAS Forecast Studio creates a project, the data is sorted by the time ID variable so that the observations are in order according to time.

Thanks,

Udo

View solution in original post

4 REPLIES 4
udo_sas
SAS Employee

Hello -

Please note that  @PGStats's suggestion will only work if you use the SAS Forecast Server procedures.

From documentation:

Requirements for Time Series Data
To generate forecasts in SAS Forecast Studio, you need time series data. You might already have this time series data, or you might have transactional data. If you have transactional data, you can use the accumulation options in SAS Forecast Studio to convert the transactional data into a time series.
Your time series data must meet the following requirements:
The data set contains one variable for each dependent variable.
The data set contains a time ID variable that identifies the time period for each observation. When SAS Forecast Studio creates a project, the data is sorted by the time ID variable so that the observations are in order according to time.

Thanks,

Udo

alexchien
Pyrite | Level 9

Please take a look at the following thread for a solution. alex

 

https://communities.sas.com/t5/forums/searchpage/tab/message?filter=labels%2Clocation&location=forum...

 

mitrov
SAS Employee

The reason why you see strange dates in the plot x-axis is that the observation numbers you are using for ID variables are intepreted as SAS dates and reformatted according to the interval specified. SAS dates are number of days since a cutoff data, which by default is 1960. If you run the following examples you will see what I mean. The "dateid" variable is formatted as date9., which is the default for DAY interval, so it prints as 02JAN1960 and so on.

 

 

data air;
   set sashelp.air;
   id = _n_;
   dateid = id;
   newdateid = id-"01Jan1960"d - 1;
   format dateid date9. newdateid day9.;
run;

proc print data=air(obs=32); run;

 

SAS dates and formats are explained in more details here: 

http://support.sas.com/documentation/cdl/en/etsug/68148/HTML/default/viewer.htm#etsug_tsdata_sect006...

 

I don't have access to FS as I am writing but I don't think you can remove the format that is assigned automatically according to the INTERVAL specified. Someone else may correct me if I am wrong.  

  

As you see in the example above, I created a new variable "newdateid" that I recentered around 01Jan1960 and formatted as day9. If you use newdateid as your ID variable it will show the day of the month only on the x-axis, which is closer to what you want. However that's not a perfect solution since it will start again from 1 when February starts, and so on for every month.

 

 

sas-innovate-2024.png

 

Time is running out to save with the early bird rate. Register by Friday, March 1 for just $695 - $100 off the standard rate.

 

Check out the agenda and get ready for a jam-packed event featuring workshops, super demos, breakout sessions, roundtables, inspiring keynotes and incredible networking events. 

 

Register now!

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
  • 1133 views
  • 1 like
  • 5 in conversation