Forecasting using SAS Forecast Server, SAS/ETS, and more

Example time series 1,2,3,4...

Accepted Solution Solved
Reply
New Contributor
Posts: 4
Accepted Solution

Example time series 1,2,3,4...

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...


Accepted Solutions
Solution
‎07-11-2016 04:04 AM
SAS Employee
Posts: 416

Re: Example time series 1,2,3,4...

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


All Replies
Respected Advisor
Posts: 4,925

Re: Example time series 1,2,3,4...

Solution
‎07-11-2016 04:04 AM
SAS Employee
Posts: 416

Re: Example time series 1,2,3,4...

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

SAS Super FREQ
Posts: 93

Re: Example time series 1,2,3,4...

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...

 

SAS Employee
Posts: 38

Re: Example time series 1,2,3,4...

[ Edited ]

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.

 

 

☑ This topic is solved.

Need further help from the community? Please ask a new question.

Discussion stats
  • 4 replies
  • 463 views
  • 1 like
  • 5 in conversation