Learning SAS? Welcome to the exclusive online community for all SAS learners.

forecast

Reply
Occasional Learner
Posts: 1

forecast

hello
when I do forecast procedure the result stop in 2015 which does not give a forecast for the next years
can you please help me with this issue
this is my code

Options Linesize=80;
data costwater;

input year 1-4 cost 5-11 ;

date=mdy(1,1,year);

format date year4.;

yr2003=(year=2003);

output;
cards;
2003 3.4630
2004 3.116
2005 3.494
2006 4.679
2007 5.550
2008 7.219
2009 7.171
2010 8.418
201110.296
201211.626
201310.836
201410.836
2015 9.595
;


proc means data=costwater;

proc corr data=costwater;
var cost ;

Proc arima data=costwater plots=forecast(forecast);

Identify var=cost(1) crosscorr=(yr2003(1)) nlag=11;


Estimate input=yr2003 q=(1) p=(3);

Run;
forecast lead=6 interval=year id=date printall out=result;
run;
quit;

proc print data=result;
run;



/*Proc forecast data=water(where=(year<2016)) lead=20 out=pred;*/

/*id date;*/

/*var prod consum;*/

/*run;*/

/*proc print data=est;*/

/*proc print data=pred;*/

/*run;*/

/*proc sgplot data=pred;*/

/*series x=date y=prod/group=_type_lineattrs=(pattern=1);*/

/*refline '01jan2016'd/axis=x;*/

/*run;*/
SAS Moderator
Posts: 66

Re: forecast [how to improve your question]

Hello @khdoi,


Your question requires more details before experts can help. Can you revise your question to include more information? 

 

Review this checklist:

  • Specify a meaningful subject line for your topic.  Avoid generic subjects like "need help," "SAS query," or "urgent."
  • When appropriate, provide sample data in text or DATA step format.  See this article for one method you can use.
  • If you're encountering an error in SAS, include the SAS log or a screenshot of the error condition. Use the Photos button to include the image in your message.
    use_buttons.png
  • It also helps to include an example (table or picture) of the result that you're trying to achieve.

To edit your original message, select the "blue gear" icon at the top of the message and select Edit Message.  From there you can adjust the title and add more details to the body of the message.  Or, simply reply to this message with any additional information you can supply.

 

edit_post.png

SAS experts are eager to help -- help them by providing as much detail as you can.

 

This prewritten response was triggered for you by fellow SAS Support Communities member @BeverlyBrown

.
SAS Employee
Posts: 417

Re: forecast

Hello -

As you are using an independent variable (yr2003) in your model, you will have to provide forecasts for the independent variable too.

In the output window you will find a note which suggests that there is an issue with your model:

Warning: More values of input variable yr2003 are needed.

 

The value for option LEAD= has been reduced to 0.

 

Here is an example, which might be useful (featuring ESM and AUTOREG procedures, but the idea is the same):

http://support.sas.com/documentation/cdl/en/etsug/63939/HTML/default/viewer.htm#etsug_esm_sect027.ht...

 

Hope this helps,

Udo

Ask a Question
Discussion stats
  • 2 replies
  • 257 views
  • 1 like
  • 3 in conversation