/* This program generates some cointegrated series under various settings for use in the "learning by doing" paper. The various cases covered coincide with those described in EVIEWS 3.0 User's guide, pp. 507 - 508. */ options pagesize=60 linesize=74 nodate; goptions device=hpljs3 gsfname=plot rotate=landscape gsfmode=append target=hpljs3; *border; filename Plot 'c:\papers\cointlrn.plt'; data caseA; alpha = 0; mu1 = 0; rhox = 0.5; ex1 = 0; rhoy = 0.5; ey1 = 0; do i = -50 to 150; emu = rannor(11111); ux = rannor(22222); uy = rannor(33333); 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 = caseA; title1 'Figure 5A'; title2 'Cointegrated Time Series'; title3 'Model 4 Case a: No Deterministic Trends in Series and the'; title4 ' Cointegrating Relationship has no Intercept'; proc gplot data=caseA; symbol1 c=black v=y h=.8; symbol2 c=black v=x h=.8; title1 'Figure 5A'; title2 'Cointegrated Time Series'; title3 'Model 4 Case a: No Deterministic Trends in Series and the'; title4 ' Cointegrating Relationship has no Intercept'; axis1 order=(0 to 150 by 10) label=(f=duplex 'Obs'); axis2 order=(-30 to 20 by 10) label=(f=duplex 'C.I. Time Series'); plot y*obs = 1 x*obs = 2 / overlay haxis=axis1 vaxis=axis2; run; data caseB; alpha = 0; mu1 = 0; rhox = 0.5; ex1 = 0; rhoy = 0.5; ey1 = 0; do i = -50 to 150; emu = rannor(11111); ux = rannor(22222); uy = rannor(33333); 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 = caseB; title1 'Figure 5B'; title2 'Cointegrated Time Series'; title3 'Model 4 Case b: No Deterministic Trends in Series and the'; title4 ' Cointegrating Relationship has an Intercept'; proc gplot data=caseB; symbol1 c=black v=y h=.8; symbol2 c=black v=x h=.8; title1 'Figure 5B'; title2 'Cointegrated Time Series'; title3 'Model 4 Case b: No Deterministic Trends in Series and the'; title4 ' Cointegrating Relationship has an Intercept'; axis1 order=(0 to 150 by 10) label=(f=duplex 'Obs'); axis2 order=(-40 to 40 by 10) label=(f=duplex 'C.I. Time Series'); plot y*obs = 1 x*obs = 2 / overlay haxis=axis1 vaxis=axis2; run; data caseC; alpha = 0.2; mu1 = 0; rhox = 0.5; ex1 = 0; rhoy = 0.5; ey1 = 0; do i = -50 to 150; emu = rannor(11111); ux = rannor(22222); uy = rannor(33333); 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 = caseC; title1 'Figure 5C'; title2 'Cointegrated Time Series'; title3 'Model 4 Case c: Series have Linear Trends but'; title4 ' Cointegrating Relationship has only Intercept'; proc gplot data=caseC; symbol1 c=black v=y h=.8; symbol2 c=black v=x h=.8; title1 'Figure 5C'; title2 'Cointegrated Time Series'; title3 'Model 4 Case c: Series have Linear Trends but'; title4 ' Cointegrating Relationship has only Intercept'; axis1 order=(0 to 150 by 10) label=(f=duplex 'Obs'); axis2 order=(-10 to 60 by 10) label=(f=duplex 'C.I. Time Series'); plot y*obs = 1 x*obs = 2 / overlay haxis=axis1 vaxis=axis2; run; data caseD; alpha = 0.2; mu1 = 0; rhox = 0.5; ex1 = 0; rhoy = 0.5; ey1 = 0; do i = -50 to 150; emu = rannor(11111); ux = rannor(22222); uy = rannor(33333); 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 = caseD; title1 'Figure 5D'; title2 'Cointegrated Time Series'; title3 'Model 4 Case d: Series Have Linear Trends and the Cointegrating'; title4 ' Relationship has Deterministic Trend as Well'; proc gplot data=caseD; symbol1 c=black v=y h=.8; symbol2 c=black v=x h=.8; title1 'Figure 5D'; title2 'Cointegrated Time Series'; title3 'Model 4 Case d: Series Have Linear Trends and the Cointegrating'; title4 ' Relationship has Deterministic Trend as Well'; axis1 order=(0 to 150 by 10) label=(f=duplex 'Obs'); axis2 order=(-10 to 100 by 10) label=(f=duplex 'C.I. Time Series'); plot y*obs = 1 x*obs = 2 / overlay haxis=axis1 vaxis=axis2; run; data caseE; alpha = 0.2; mu1 = 0; rhox = 0.5; ex1 = 0; rhoy = 0.5; ey1 = 0; do i = -50 to 150; emu = rannor(11111); ux = rannor(22222); uy = rannor(33333); mu = alpha + mu1 + 0.01*i + 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 = caseE; title1 'Figure 5E'; title2 'Cointegrated Time Series'; title3 'Model 4 Case e: Series Have Quadratic Trends and the Cointegrating'; title4 ' Relationship has Deterministic Trend as Well'; proc gplot data=caseE; symbol1 c=black v=y h=.8; symbol2 c=black v=x h=.8; title1 'Figure 5E'; title2 'Cointegrated Time Series'; title3 'Model 4 Case e: Series Have Quadratic Trends and the Cointegrating'; title4 ' Relationship has Deterministic Trend as Well'; axis1 order=(0 to 150 by 10) label=(f=duplex 'Obs'); axis2 order=(-20 to 200 by 10) label=(f=duplex 'C.I. Time Series'); plot y*obs = 1 x*obs = 2 / overlay haxis=axis1 vaxis=axis2; run;