/* This program generates some cointegrated series under various settings */ /* Case 1: no drift in x and y, no constant in C.I. relationship, no trend in C.I. relationship. */ options pagesize=60 linesize=74 nodate; goptions reset=all device=win target=winprtm rotate=landscape; data case1; alpha = 0; mu1 = 0; rhox = 0.5; ex1 = 0; rhoy = 0.5; ey1 = 0; do i = -50 to 150; emu = rannor(3); ux = rannor(2); uy = rannor(5); mu = alpha + mu1 + emu; ex = rhox*ex1 + ux; ey = rhoy*ey1 + uy; x = mu + ex + 0.5*ey; y = 1.0*mu + ey + 0.5*ex; obs = i; if i > 0 then output; mu1 = mu; ex1 = ex; ey1 = ey; end; keep obs x y; proc print data = case1; title1 'Cointegrated Time Series'; title2 'Case 1: No drift in Series, no constant in C.I. relationship'; title3 ' no trend in C.I. relationship'; proc gplot data=case1; symbol1 c=black v=y h=.8; symbol2 c=black v=x h=.8; title1 'Cointegrated Time Series'; title2 'Case 1: No drift in Series, no constant in C.I. relationship'; title3 ' no trend in C.I. relationship'; axis1 order=(0 to 150 by 10) label=(f=duplex 'Obs'); axis2 order=(-5 to 25 by 5) label=(f=duplex 'C.I. Time Series'); plot y*obs = 1 x*obs = 2 / overlay haxis=axis1 vaxis=axis2; run; data case2; alpha = 0; mu1 = 0; rhox = 0.5; ex1 = 0; rhoy = 0.5; ey1 = 0; do i = -50 to 150; emu = rannor(3); ux = rannor(2); uy = rannor(5); mu = alpha + mu1 + emu; ex = rhox*ex1 + ux; ey = rhoy*ey1 + uy; x = mu + ex + 0.5*ey; y = 10 + 1.0*mu + ey + 0.5*ex; obs = i; if i > 0 then output; mu1 = mu; ex1 = ex; ey1 = ey; end; keep obs x y; proc print data = case2; title1 'Cointegrated Time Series'; title2 'Case 2: No drift in Series, constant in C.I. relationship'; title3 ' no trend in C.I. relationship'; proc gplot data=case2; symbol1 c=black v=y h=.8; symbol2 c=black v=x h=.8; title1 'Cointegrated Time Series'; title2 'Case 2: No drift in Series, constant in C.I. relationship'; title3 ' no trend in C.I. relationship'; axis1 order=(0 to 150 by 10) label=(f=duplex 'Obs'); axis2 order=(-3 to 33 by 3) label=(f=duplex 'C.I. Time Series'); plot y*obs = 1 x*obs = 2 / overlay haxis=axis1 vaxis=axis2; run; data case3a; alpha = 0.2; mu1 = 0; rhox = 0.5; ex1 = 0; rhoy = 0.5; ey1 = 0; do i = -50 to 150; emu = rannor(3); ux = rannor(2); uy = rannor(5); mu = alpha + mu1 + emu; ex = rhox*ex1 + ux; ey = rhoy*ey1 + uy; x = mu + ex + 0.5*ey; y = 1.0*mu + ey + 0.5*ex; obs = i; if i > 0 then output; mu1 = mu; ex1 = ex; ey1 = ey; end; keep obs x y; proc print data = case3a; title1 'Cointegrated Time Series'; title2 'Case 3a: Drift in Series, no constant in C.I. relationship'; title3 ' no trend in C.I. relationship'; proc gplot data=case3a; symbol1 c=black v=y h=.8; symbol2 c=black v=x h=.8; title1 'Cointegrated Time Series'; title2 'Case 3a: Drift in Series, no constant in C.I. relationship'; title3 ' no trend in C.I. relationship'; axis1 order=(0 to 150 by 10) label=(f=duplex 'Obs'); axis2 order=(0 to 70 by 10) label=(f=duplex 'C.I. Time Series'); plot y*obs = 1 x*obs = 2 / overlay haxis=axis1 vaxis=axis2; run; data case3b; alpha = 0.2; mu1 = 0; rhox = 0.5; ex1 = 0; rhoy = 0.5; ey1 = 0; do i = -50 to 150; emu = rannor(3); ux = rannor(2); uy = rannor(5); mu = alpha + mu1 + emu; ex = rhox*ex1 + ux; ey = rhoy*ey1 + uy; x = mu + ex + 0.5*ey; y = 10 + 1.0*mu + ey + 0.5*ex; obs = i; if i > 0 then output; mu1 = mu; ex1 = ex; ey1 = ey; end; keep obs x y; proc print data = case3b; title1 'Cointegrated Time Series'; title2 'Case 3b: Drift in Series, constant in C.I. relationship'; title3 ' no trend in C.I. relationship'; proc gplot data=case3b; symbol1 c=black v=y h=.8; symbol2 c=black v=x h=.8; title1 'Cointegrated Time Series'; title2 'Case 3b: Drift in Series, constant in C.I. relationship'; title3 ' no trend in C.I. relationship'; axis1 order=(0 to 150 by 10) label=(f=duplex 'Obs'); axis2 order=(0 to 70 by 10) label=(f=duplex 'C.I. Time Series'); plot y*obs = 1 x*obs = 2 / overlay haxis=axis1 vaxis=axis2; run; data case4a; alpha = 0.2; mu1 = 0; rhox = 0.5; ex1 = 0; rhoy = 0.5; ey1 = 0; do i = -50 to 150; emu = rannor(3); ux = rannor(2); uy = rannor(5); mu = alpha + mu1 + emu; ex = rhox*ex1 + ux; ey = rhoy*ey1 + uy; x = mu + ex + 0.5*ey; y = 1.0*mu + 0.2*i + ey + 0.5*ex; obs = i; if i > 0 then output; mu1 = mu; ex1 = ex; ey1 = ey; end; keep obs x y; proc print data = case4a; title1 'Cointegrated Time Series'; title2 'Case 4a: Drift in Series, no constant in C.I. relationship'; title3 ' trend in C.I. relationship'; proc gplot data=case4a; symbol1 c=black v=y h=.8; symbol2 c=black v=x h=.8; title1 'Cointegrated Time Series'; title2 'Case 4a: Drift in Series, no constant in C.I. relationship'; title3 ' trend in C.I. relationship'; axis1 order=(0 to 150 by 10) label=(f=duplex 'Obs'); axis2 order=(0 to 120 by 10) label=(f=duplex 'C.I. Time Series'); plot y*obs = 1 x*obs = 2 / overlay haxis=axis1 vaxis=axis2; run; data case4b; alpha = 0.2; mu1 = 0; rhox = 0.5; ex1 = 0; rhoy = 0.5; ey1 = 0; do i = -50 to 150; emu = rannor(3); ux = rannor(2); uy = rannor(5); mu = alpha + mu1 + emu; ex = rhox*ex1 + ux; ey = rhoy*ey1 + uy; x = mu + ex + 0.5*ey; y = 10 + 1.0*mu + 0.2*i + ey + 0.5*ex; obs = i; if i > 0 then output; mu1 = mu; ex1 = ex; ey1 = ey; end; keep obs x y; proc print data = case4b; title1 'Cointegrated Time Series'; title2 'Case 4b: Drift in Series, constant in C.I. relationship'; title3 ' trend in C.I. relationship'; proc gplot data=case4b; symbol1 c=black v=y h=.8; symbol2 c=black v=x h=.8; title1 'Cointegrated Time Series'; title2 'Case 4b: Drift in Series, constant in C.I. relationship'; title3 ' trend in C.I. relationship'; axis1 order=(0 to 150 by 10) label=(f=duplex 'Obs'); axis2 order=(0 to 120 by 10) label=(f=duplex 'C.I. Time Series'); plot y*obs = 1 x*obs = 2 / overlay haxis=axis1 vaxis=axis2; run;