How to predict unemployment rate in US by SAS/ETS

This post was kindly contributed by SAS Analysis - go there to comment and to read the full post.


The raw data: here


FILENAME data URL "http://research.stlouisfed.org/fred2/data/UNRATE.txt" DEBUG LRECL=100;

data one;
infile data;
input @1 year 4. @6 month 2. @9 day 2. uer;
DATE = MDY(MONTH,DAY,YEAR);
FORMAT DATE monyy7.;
drop year month day;
if date=. then delete;
run;


proc forecast data=one out=uerp1 out1step
lead=12 interval=month;
id date;
var uer;
run;

proc arima data=one;
i var=uer;
e p=1 q=12;
f lead=12 interval=month id=date out=uerp2;
run;
quit;
data two;
set uerp1(keep=date uer
rename=(uer=pforecast));
set uerp2(keep=date uer forecast
rename=(uer=actual forecast=parima));
run;
title 'Unemployment rate';
ods listing close;
ods html file="prediction.html" style=gears image_dpi=300;

ods graphics /reset imagename='Table' imagefmt=gif;
proc sgplot data=two;
series x= date y=actual;
series x= date y=pforecast / legendlabel='predication by proc forecast';
series x= date y=parima / legendlabel='predication by proc arima ';
refline '01mar2010'd '01mar2011'd /axis=x transparency=0.5 label=('Mar2010' 'Mar2011');
yaxis values=(3 to 12 by 1) label='Percentage';
where date>'01mar1990'd ;
run;

ods html close;
ods listing;



This post was kindly contributed by SAS Analysis - go there to comment and to read the full post.