* * RATS Program for Fama efficient markets analysis * pp 176-182, based upon pp 150-158 * cal(m) 1950:2 * * Read in data * column 1: year * column 2: month * column 3: 1-month inflation rate * column 4: 3-month inflation rate * column 5: 1-month T-bill rate * column 6: 3-month T-bill rate * column 7: cpi * open data mishkin.xls data(org=columns,format=xls) 1950:2 1990:12 year month pai1 pai3 tb1 tb3 cpi * * create variables * set pai = ((cpi/cpi{1})**12-1)*100 set r = tb1-pai graph(footer="Figure 2.3 Inflation and Interest Rates",key=below,$ klabels=||"1-month T-bill rate","Inflation rate"||) 2 # tb1 # pai graph(footer="Figure 2.4 Real Interest Rates") # r * * Part (d): test for serial correlation * simple statistics * * METHOD=YULE is used to get the statistics shown in the text. The default method * for RATS versions 5 and later is METHOD=BURG, which gives similar results when * the autocorrelations are small, but more accurate results when they are close * to 1. * table 1953:1 1971:7 tb1 pai r correlate(qstats,number=12,span=1,method=yule) r 1953:1 1971:7 * * Part (e): Fama regressions 1953:1 to 1971:7 * w/o conditional homoskedasticity * linreg(robusterrors) pai 1953:1 1971:7;# constant tb1 test;# 2;# 1 * * Part (f): Conditional heteroskedasticity with various * finite-sample corrections * linreg(noprint) pai 1953:1 1971:7 resids ;# constant tb1 compute xxols=%xx prj(xvx=p) * * With degrees of freedom correction * mcov(lastreg) / resids linreg(create,lastreg,form=chisq,$ covmat=xxols*%cmom*xxols*(float(%nobs)/%ndf),$ title="OLS with DM Adjustment to White Std Errors") test;# 2;# 1 * * With (1-p)**1 correction - divide resids by sqrt(1-p) so that squaring will get * the right factor. * set p1resids = resids/sqrt(1-p) mcov(lastreg) / p1resids linreg(create,lastreg,form=chisq,$ covmat=xxols*%cmom*xxols,$ title="OLS with DM (p=1) Standard Errors") test;# 2;# 1 * * With (1-p)**2 correction * set p2resids = resids/(1-p) mcov(lastreg) / p2resids linreg(create,lastreg,form=chisq,$ covmat=xxols*%cmom*xxols,$ title="OLS with DM (p=2) Standard Errors") test;# 2;# 1 * * Part (g): Fama regressions 1953:1 to 1971:7 with conditional homoskedasticity * linreg pai 1953:1 1971:7 resids;# constant tb1 test;# 2;# 1 * * Part (h): Breusch-Godfrey * As described on page 147, the pre-sample residuals are set to zero. * set resids 1952:1 1952:12 = 0 linreg resids 1953:1 1971:7 # constant tb1 resids{1 to 12} cdf(title="Breusch-Godfrey Autocorrelation Test") chisquared %trsquared 12 * * Part (j): Add seasonal dummies to Fama regression * seasonal mdummies linreg pai 1953:1 1971:7 # mdummies{0 to -11} tb1 * * Part (k): Fama regression with better inflation measure * linreg(robusterrors) pai1 1953:1 1971:7 # constant tb1 test;# 2;# 1 * * Part (l): Past October 1979. * linreg(robusterrors) pai1 1979:11 1990:12 # constant tb1 test;# 2;# 1