BookmarkSubscribeRSS Feed
dsriggs
Fluorite | Level 6

Is there a way I can name the forecasted values from Proc Arima in the out dataset?  For example with Proc Reg I could do something like:

proc reg data=data outest=reg noprint;
name:model y=x;
run;

proc score data=data score=reg type=parms predict out=pred;
var x;
run;

And the forecasted values will be called "name".  Is there a way to do something like this with Proc Arima?  Whenever I use the out statement it stores the forecasts as "forecast of y".

2 REPLIES 2
alexchien
Pyrite | Level 9

the "forecast of y" is actually the lable of the column, not the column name. The standard column name produced by proc arima is FORECAST. You can use the standard sas RENAME statement to change the column name of the output table. For example:

 

/*name the forecast column "xyz"*/

proc arima data=sashelp.air;
    identify var=air(1,12);
    estimate q=(1)(12) noint method=ml;

    forecast id=date interval=month out=b (rename=(forecast = xyz));
run;
quit;

 

udo_sas
SAS Employee

Hello -

In addition to @alexchien's response I'd like to add: as ARIMA creates a common SAS data set one can use utility procedures such as DATASETS to modify attributes such as labels and names. For example if you would like to change both name and label of a variable produced by ARIMA this code snippet might be of interest.

Thanks,

Udo

 

proc arima data=sashelp.air;

identify var=air(1,12);

estimate q=(1)(12) noint method=ml;

forecast id=date interval=month out=work.want;

run;

proc datasets lib=work memtype=data nodetails nolist;

modify want;

attrib forecast label="Hello World";

rename forecast=MYNAME;

quit;

sas-innovate-2024.png

Don't miss out on SAS Innovate - Register now for the FREE Livestream!

Can't make it to Vegas? No problem! Watch our general sessions LIVE or on-demand starting April 17th. Hear from SAS execs, best-selling author Adam Grant, Hot Ones host Sean Evans, top tech journalist Kara Swisher, AI expert Cassie Kozyrkov, and the mind-blowing dance crew iLuminate! Plus, get access to over 20 breakout sessions.

 

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
  • 2 replies
  • 1083 views
  • 0 likes
  • 3 in conversation