How to forecast or extrapolate only missing values and nothing beyond that?

Accepted Solution Solved
Reply
Occasional Contributor
Posts: 16
Accepted Solution

How to forecast or extrapolate only missing values and nothing beyond that?

I have data with missing values at the end of the time series. I have different products and the amount of missing monthly values varies by item and by year. How do I forecast/extrapolate these missing values only? (without going beyond the year in which the item is purchased)

Ex.

Item     year     month     value

a          2000     1              12

a          2000     2              243

a          2000     3              234

a          2000     4             123

a          2000     5             23

a          2000     6               .

a          2000     7               .

a          2000     8               .

a          2000     9               .

a          2000     10               .

a          2000     11             .

a          2000     12             .

When i use proc forecase, it is not forecasting the missing values. But based on the example above, it would only extrapolate 12 values for 2001.

Here is the base code that i am using.

proc forecast data=old out=new

          method=expo trend=3

          interval=month;

     by item;

     id month; *month is date variable with format monyy;

     var value;

run;

Perhaps another procedure would work? Any suggestions?


Accepted Solutions
Solution
‎12-20-2012 11:33 AM
Occasional Contributor
Posts: 16

Re: How to forecast or extrapolate only missing values and nothing beyond that?

Solution found: After trend statement, specify lead=0.

View solution in original post


All Replies
Solution
‎12-20-2012 11:33 AM
Occasional Contributor
Posts: 16

Re: How to forecast or extrapolate only missing values and nothing beyond that?

Solution found: After trend statement, specify lead=0.

SAS Employee
Posts: 416

Re: How to forecast or extrapolate only missing values and nothing beyond that?

Hello -

As an alternative you might consider PROC ESM instead.

Here is an example.

Thanks,

Udo

data example;

set sashelp.air(in=l) sashelp.air;

if l then do;

group=1;

if date ge "01JAN1960"d then air=.;

end;

else do;

group=2;

if date ge "01JUN1960"d then air=.;

end;

run;

proc sort data=example;by group date;run;

proc esm data=example out=_null_ outfor=want lead=0;

     id date interval=month ;

     forecast air / method=winters;

  by group;

run;

🔒 This topic is solved and locked.

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

Discussion stats
  • 2 replies
  • 800 views
  • 0 likes
  • 2 in conversation