SAS/ETS Examples
Tourism Demand Modeling and Forecasting with PROC VARMAX
Contents |
Back to Example
/*-------------------------------------------------------------------
Example: Tourism Demand Modeling and Forecasting Using PROC VARMAX
Requires: SAS/ETS
Version: 9.0
-------------------------------------------------------------------*/
data tourism ;
set sashelp.tourism;
lpvsp = log(vsp);
lppdi = log(pdi);
lrcsp = log( (cpisp/exsp)/(puk/exuk) );
label lpvsp='log(per capita holiday visits to Spain)'
lppdi='log(per capita disposable income)'
lrcsp='log(living costs in Spain relative to
UK living costs adjusted by the exchange rate)';
run;
proc gplot data = tourism ;
plot lpvsp*year / cframe = ligr vaxis = axis1 haxis = axis2 ;
title 'Log of Per Capita Holiday Visits to Spain' ;
symbol c = blue i = join v = star ;
axis1 label = (angle=90 'log(per capita visits to Spain)') ;
axis2 label = ('Year') ;
run ;
quit ;
proc varmax data=tourism;
id year interval=year;
model lpvsp lppdi lrcsp / p=1 print=(parcoef pcorr pcancorr) lagmax=6 ;
run ;
proc varmax data=tourism;
id year interval=year;
model lpvsp lppdi lrcsp / p=1;
/* Test for Causality */
causal group1=(lrcsp) group2=(lpvsp lppdi);
run;
/* Fit the VARX(1,1) model */
proc varmax data=tourism;
id year interval=year;
model lpvsp lppdi = lrcsp / p=1 xlag=1 ;
run;
/* Fit the VARX(1,1) model with parameter restriction */
proc varmax data=tourism;
id year interval=year;
model lpvsp lppdi = lrcsp / p=1 xlag=1;
restrict XL(0,1,1) = 0 XL(1,2,1)=0;
output out=forecasts lead=6;
run;
%forgraph(forecasts,timeid=year, interval=year,
actual=lpvsp, forecast=for1, lower=lci1, upper=uci1);