/* This program is intended to demonstrate the effects of changes in x(t)
on various types of time series regression models. The first model we will
examine is the pure distributed lag model yt = 0.7x(t) + 0.5x(t-1)
+ 0.3x(t-2). (Model 1). Secondly, we will examine the autoregressive
distributed lag model yt = 0.7x(t) + 0.5x(t-1) + 0.3x(t-2) + 0.8y(t-1).
(Model 2). */
/* Here we examine the effect on model 1 of keeping x(t) at zero for t = -20, -10, ... -1
and then at time t = 0 make x(t) = 1 and then x(t) = 0 again thereafter (i.e. a temporary
change in xt). This will help us plot the distributed lag function of model one. */
Options Nodate;
data dynamic;
yt=0;
yt1=0;
xt=0;
xt1=0;
xt2=0;
do t = -20 to 20;
if t = 0 then xt = 1;
if t = 1 then xt = 0;
if t = 2 then xt1 = 0;
if t = 3 then xt2 = 0;
yt = 0.7*xt + 0.5*xt1 + 0.3*xt2;
output;
yt1=yt;
xt2=xt1;
xt1=xt;
end;
run;
title 'Pulse change in x(t) at time t = 0';
proc plot data=dynamic;
plot xt*t;
run;
title1 'Effect of Pulse Change in x(t) on y(t) for Model 1:';
title2 'y(t) = 0.7x(t-1) + 0.5x(t-2)+ 0.3x(t-3)';
proc plot data=dynamic;
plot yt*t;
run;
proc print data=dynamic;
run;
/* Here we examine the effect on model 1 of keeping xt at zero for t = -20, -10, ... -1
and then at time t = 0 make x(t) = 1 and then x(t) = 1 again thereafter (i.e. a permanent
change in x(t). This will help us plot the cumulative multiplier function of model 1. */
data dynamic;
yt=0;
yt1=0;
xt=0;
xt1=0;
xt2=0;
do t = -20 to 20;
if t = 0 then xt = 1;
yt = 0.7*xt + 0.5*xt1 + 0.3*xt2;
output;
yt1=yt;
xt2=xt1;
xt1=xt;
end;
run;
title 'Step Change in x(t) at t = 0';
proc plot data=dynamic;
plot xt*t;
run;
title1 'Cumulative Multipler Effect on y(t) Arising from Step Change in x(t) for Model 1:';
title2 'y(t) = 0.7x(t-1) + 0.5x(t-2)+ 0.3x(t-3)';
proc plot data=dynamic;
plot yt*t;
run;
proc print data=dynamic;
run;
/* Here we examine the effect on model 2 of keeping x(t) at zero for t = -20, -10, ... -1
and then at time t = 0 make x(t) = 1 and then x(t) = 0 again thereafter (i.e. a temporary
change in x(t). This will help us plot the interim multiplier function of model 2. */
data dynamic;
yt=0;
yt1=0;
xt=0;
xt1=0;
xt2=0;
do t = -20 to 20;
if t = 0 then xt = 1;
if t = 1 then xt = 0;
if t = 2 then xt1 = 0;
if t = 3 then xt2 = 0;
yt = 0.7*xt + 0.5*xt1 + 0.3*xt2 + 0.8*yt1;
output;
yt1=yt;
xt2=xt1;
xt1=xt;
end;
run;
title 'Pulse change in x(t) at time t = 0';
proc plot data=dynamic;
plot xt*t;
run;
title1 'Interim Multipler Effects on y(t) of Pulse Change in x(t) for Model 2:';
title2 'y(t) = 0.7x(t-1) + 0.5x(t-2)+ 0.3x(t-3)+ 0.8y(t-1)';
proc plot data=dynamic;
plot yt*t;
run;
proc print data=dynamic;
run;
/* Here we examine the effect on model 2 of keeping xt at zero for t = -20, -10, ... -1
and then at time t = 0 make x(t) = 1 and then x(t) = 1 again thereafter (i.e. a permanent
change in x(t). This will help us plot the cumulative multiplier function of model 2. */
data dynamic;
yt=0;
yt1=0;
xt=0;
xt1=0;
xt2=0;
do t = -20 to 20;
if t = 0 then xt = 1;
yt = 0.7*xt + 0.5*xt1 + 0.3*xt2 + 0.8*yt1;
output;
yt1=yt;
xt2=xt1;
xt1=xt;
end;
run;
title 'Step Change in x(t) at t = 0';
proc plot data=dynamic;
plot xt*t;
run;
title1 'Cumulative Multipler Effects on y(t) from Step Change in x(t) for Model 2:';
title2 'y(t) = 0.7x(t-1) + 0.5x(t-2)+ 0.3x(t-3)+ 0.8y(t-1)';
proc plot data=dynamic;
plot yt*t;
run;
proc print data=dynamic;
run;