/* Extended Nelson-Plosser Data Set by Schotman and Van Dijk (1991). Industrial Production 1860 - 1988 */ /* This program's purpose is to determine what the nature of the in-sample data for Industrial Production: Log vs. Level and I(1) vs. I(0) */ options pagesize=60 linesize=74 nodate; goptions device=win gsfname=plot rotate=landscape gsfmode=append target=hpljs3; *border; data np; input obs year indprod lindprod; indprod1 = indprod - lag(indprod); lindpro1 = lindprod - lag(lindprod); cards; 1 1860 0.90000 -0.10536 2 1861 0.90000 -0.10536 3 1862 0.90000 -0.10536 4 1863 1.00000 0.00000 5 1864 1.00000 0.00000 6 1865 1.00000 0.00000 7 1866 1.20000 0.18232 8 1867 1.30000 0.26236 9 1868 1.30000 0.26236 10 1869 1.40000 0.33647 11 1870 1.50000 0.40547 12 1871 1.50000 0.40547 13 1872 1.80000 0.58779 14 1873 1.80000 0.58779 15 1874 1.70000 0.53063 16 1875 1.70000 0.53063 17 1876 1.70000 0.53063 18 1877 1.80000 0.58779 19 1878 1.90000 0.64185 20 1879 2.20000 0.78846 21 1880 2.50000 0.91629 22 1881 2.80000 1.02962 23 1882 3.00000 1.09861 24 1883 3.00000 1.09861 25 1884 2.90000 1.06471 26 1885 2.90000 1.06471 27 1886 3.50000 1.25276 28 1887 3.70000 1.30833 29 1888 3.80000 1.33500 30 1889 4.10000 1.41099 31 1890 4.40000 1.48160 32 1891 4.50000 1.50408 33 1892 4.80000 1.56862 34 1893 4.30000 1.45862 35 1894 4.20000 1.43508 36 1895 4.90000 1.58924 37 1896 4.60000 1.52606 38 1897 4.90000 1.58924 39 1898 5.60000 1.72277 40 1899 6.1000 1.80829 41 1900 6.3000 1.84055 42 1901 7.1000 1.96009 43 1902 7.9000 2.06686 44 1903 8.1000 2.09186 45 1904 7.8000 2.05412 46 1905 9.2000 2.21920 47 1906 9.8000 2.28238 48 1907 10.0000 2.30259 49 1908 8.5000 2.14007 50 1909 10.0000 2.30259 51 1910 10.6000 2.36085 52 1911 10.2000 2.32239 53 1912 11.7000 2.45959 54 1913 12.5000 2.52573 55 1914 11.7000 2.45959 56 1915 13.6000 2.61007 57 1916 16.1000 2.77882 58 1917 16.2000 2.78501 59 1918 16.0000 2.77259 60 1919 14.1000 2.64617 61 1920 14.8000 2.69463 62 1921 11.4000 2.43361 63 1922 14.5000 2.67415 64 1923 17.3000 2.85071 65 1924 16.2000 2.78501 66 1925 17.8000 2.87920 67 1926 18.9000 2.93916 68 1927 18.9000 2.93916 69 1928 19.6000 2.97553 70 1929 21.8000 3.08191 71 1930 18.1000 2.89591 72 1931 15.0000 2.70805 73 1932 11.7000 2.45959 74 1933 13.8000 2.62467 75 1934 15.1000 2.71469 76 1935 17.4000 2.85647 77 1936 20.6000 3.02529 78 1937 22.5000 3.11352 79 1938 17.800 2.87920 80 1939 21.800 3.08191 81 1940 25.500 3.23868 82 1941 31.800 3.45947 83 1942 36.600 3.60005 84 1943 44.700 3.79997 85 1944 48.300 3.87743 86 1945 41.300 3.72086 87 1946 35.200 3.56105 88 1947 39.400 3.67377 89 1948 41.000 3.71357 90 1949 38.800 3.65842 91 1950 44.900 3.80444 92 1951 48.700 3.88568 93 1952 50.600 3.92395 94 1953 54.800 4.00369 95 1954 51.800 3.94739 96 1955 58.400 4.06732 97 1956 61.000 4.11087 98 1957 61.800 4.12390 99 1958 57.800 4.05699 100 1959 64.700 4.16976 101 1960 66.200 4.19268 102 1961 66.600 4.19870 103 1962 72.100 4.27805 104 1963 76.500 4.33729 105 1964 81.800 4.40428 106 1965 89.200 4.49088 107 1966 98.000 4.58497 108 1967 100.000 4.60517 109 1968 105.800 4.66155 110 1969 110.700 4.70682 111 1970 106.700 4.67002 112 1971 108.217 4.68414 113 1972 118.685 4.77648 114 1973 128.338 4.85467 115 1974 126.434 4.83972 116 1975 115.287 4.74742 117 1976 125.891 4.83541 118 1977 135.951 4.91230 119 1978 144.788 4.97527 120 1979 150.498 5.01395 121 1980 147.643 4.99480 122 1981 150.906 5.01666 123 1982 140.166 4.94282 124 1983 148.459 5.00031 125 1984 165.045 5.10622 126 1985 168.171 5.12498 127 1986 170.075 5.13624 128 1987 176.464 5.17312 129 1988 186.525 5.22856 ; proc means data=np; var indprod indprod1 lindprod lindpro1; title 'Industrial Producion 1860 - 1988'; axis1 label=('Year'); axis2 order=(0 to 200 by 20) label=(angle=90 'CPI'); proc gplot data=np; plot indprod*year / haxis=axis1 vaxis=axis2; symbol1 i=join; run; title 'Log Industrial 1860 - 1988'; axis1 label=('Year'); axis2 order=(-1 to 7 by 0.5) label=(angle=90 'Log Ind. Prod.'); proc gplot data=np; plot lindprod*year / haxis=axis1 vaxis=axis2; symbol1 i=join; run; title 'Dif Industrial Production 1860 - 1988'; axis1 label=('Year'); axis2 order=(-15 to 20 by 5) label=(angle=90 'Dif CPI'); proc gplot data=np; plot indprod1*year / haxis=axis1 vaxis=axis2; symbol1 i=join; run; title 'Dif Log Industrial Production 1860 - 1988'; axis1 label=('Year'); axis2 order=(-0.4 to 0.4 by 0.05) label=(angle=90 'Dif Log CPI'); proc gplot data=np; plot lindpro1*year / haxis=axis1 vaxis=axis2; symbol1 i=join; run; /* This part conducts a log vs. levels test of the CPI data. */ data loglev; set np; x = indprod; lnx = lindprod; t = _n_; proc reg data=loglev noprint; model x = t; output out=resx residual=resx; model lnx = t; output out=reslnx residual=reslnx; data combine; merge resx reslnx; keep resx reslnx; proc means data=combine uss noprint; var resx reslnx; output out=test uss = resx reslnx; /* Here is where the VIT and V2T statistics for determining whether the log or level forms should be chosen for the time series x. Reference: "Choosing Between Levels and Logs in the Presence of Deterministic and Stochastic Trends" by Valentina Corradi and Norman R. Swanson, working paper, May, 1997, University of Pennyslvania. */ /* Test Using All of the Data obs. 1 - 129 */ data test; set test; tobs = 129; v1tx = (((tobs**-1.5)*reslnx)**2)/(((tobs**-1)*resx)**2); v2tx = (tobs**-4)*resx*reslnx; proc print data = test; var v1tx v2tx; title 'CS Test Using All of the Data'; run; /* In-Sample Data Set = Obs. 1 - 96 */ /* Out-of-Sample Data Set = Obs. 97 - 129 (no. obs = 33) */ /* CS Test Using Only the In-Sample Data Set Obs. 1 - 96 */ proc reg data=loglev(obs=96) noprint; model x = t; output out=resx residual=resx; model lnx = t; output out=reslnx residual=reslnx; data combine2; merge resx reslnx; keep resx reslnx; proc means data=combine2 uss noprint; var resx reslnx; output out=test2 uss = resx reslnx; data test2; set test2; tobs = 96; v1tx = (((tobs**-1.5)*reslnx)**2)/(((tobs**-1)*resx)**2); v2tx = (tobs**-4)*resx*reslnx; proc print data = test2; var v1tx v2tx; title 'CS Test Using Only the In-Sample Data Set Obs. 1 - 96'; run; /* Now we proceed to test the level of CPI to be either I(1) or I(0) using the in-sample data set and the %dftest macro available in SAS. */ data np2; set np; x = indprod; if _n_ < 97; title 'Unit Root tests for Level Industrial Production over in-sample data set'; %dftest(np2,x,ar=4,trend=2,outstat=result); proc print data=result; %dftest(np2,x,ar=3,trend=2,outstat=result); proc print data=result; %dftest(np2,x,ar=2,trend=2,outstat=result); proc print data=result; %dftest(np2,x,ar=1,trend=2,outstat=result); proc print data=result; %dftest(np2,x,ar=0,trend=2,outstat=result); proc print data=result; %dftest(np2,x,ar=4,trend=1,dif=(1),outstat=result); proc print data=result; %dftest(np2,x,ar=3,trend=1,dif=(1),outstat=result); proc print data=result; %dftest(np2,x,ar=2,trend=1,dif=(1),outstat=result); proc print data=result; %dftest(np2,x,ar=1,trend=1,dif=(1),outstat=result); proc print data=result; %dftest(np2,x,ar=0,trend=1,dif=(1),outstat=result); proc print data=result; run; /* RESULT: Industrial Production IS I(1) IN LEVELS */ /* Now we proceed to test the level of Log Indprod to be either I(1) or I(0) using the in-sample data set and the %dftest macro available in SAS. */ data np2; set np; x = lindprod; if _n_ < 97; title 'Unit Root tests for Log CPI over in-sample data set'; %dftest(np2,x,ar=4,trend=2,outstat=result); proc print data=result; %dftest(np2,x,ar=3,trend=2,outstat=result); proc print data=result; %dftest(np2,x,ar=2,trend=2,outstat=result); proc print data=result; %dftest(np2,x,ar=1,trend=2,outstat=result); proc print data=result; %dftest(np2,x,ar=0,trend=2,outstat=result); proc print data=result; %dftest(np2,x,ar=4,trend=1,dif=(1),outstat=result); proc print data=result; %dftest(np2,x,ar=3,trend=1,dif=(1),outstat=result); proc print data=result; %dftest(np2,x,ar=2,trend=1,dif=(1),outstat=result); proc print data=result; %dftest(np2,x,ar=1,trend=1,dif=(1),outstat=result); proc print data=result; %dftest(np2,x,ar=0,trend=1,dif=(1),outstat=result); proc print data=result; run; /* RESULT: Log Indprod IS I(1) IN LEVELS */