Programs for "Tests of the Market's Reaction to Federal Funds Rate Target Changes" by Daniel L. Thornton [Review, November/December 1998, pp. 25-36] The first program is an EViews (Version 3.1) program that performs all regressions. The second program is a SAS (Version 6.12, HP-UX) that performs the Monte-Carlo simulation for the critical values on page 27. --------------------------------------------------------------------- Start of EViews Program --------------------------------------------------------------------- ' Nov. 24, 1998 ' ' d:\dan\market_reaction\fred_datapgm\mkt_react.prg ' ' PROGRAM FOR "Tests of the Market's Reaction to Federal Funds Rate Target Changes" ' ' Written in Eviews (version 3.1) ' ' ' create u 1 3835 read(t=txt,na= .,mult,d=s,name,label=34) d:\dan\market_reaction\fred_datapgm\9811dt.dat date ff fftar t3m t12m t10y t30y dr type dum_nd 'save d:\dan\market_reaction\mkt_react.wf1 ' '~~~~ Create output text file of resutls ~~~~ 'output(t) d:\dan\market_reaction\eviews_output ' ' ' ' Create sample range for entire set (October 6, 1982 - December 31, 1997) sample entire @first @last ' Create Full sample range (October 2, 1989 - December 31, 1997) sample full 1761 @last ' Create extended sample range name (March 1, 1984 - December 31, 1997) sample extend 355 @last ' Create sample range name for Appendix (October 6, 1982 - August 10, 1987) sample appenda @first 1222 ' Create sample range name for Appendix (August 11, 1987 - December 31, 1997) sample appendb 1223 @last ' ' ' smpl entire series dtar=d(fftar) for %a t3m t12m t10y t30y series d{%a}=d(%a) series ad{%a}=abs(d%a) next ' ' ' ~~~~ Set sample to Oct 2, 1989 - Dec 31, 1997 ~~~~ smpl full ' ' ~~~~ Data and estimation of Equation #1 (Table 1) ~~~~ for %i t3m t12m t10y t30y equation eq1_{%i}.ls(n,p) d{%i} c dtar next ' ' ' ~~~~ Mean and Median Absolute Change in Rates ~~~~ for %ii t10y t30y smpl full if abs(dtar)>0 hist(p) abs(d%ii) smpl full if dtar=0 hist(p) abs(d%ii) next ' ' ' ~~~~ Reset Sample to Oct. 2, 1989 - Dec. 1997 smpl full ' ' ~~~~ Correlation Matrix for Table 2~~~~ group dirates dt3m dt12m dt10y dt30y freeze(cor_matrix) dirates.cor(p) print cor_matrix ' ' ' ~~~~ Data and estimation of Equation #2 (Table 3) ~~~~ for %k t12m t10y t30y equation eq2_{%k}.ls(n,p) d{%k} c dt3m dtar next ' ' ' ~~~~ Data and estimation of Equation #3 (Table 4) ~~~~ series dtar_lg dtar_lg=dtar*(abs(dtar)>0.25) series dtar_sm dtar_sm=dtar*(abs(dtar)=0.25) freeze(dtar_lgsm) date dtar dtar_lg dtar_sm 'show dtar_lgsm ' equation eq3_t3m.ls(n,p) dt3m c dtar_lg dtar_sm eq3_t3m.wald(p) c(2)=c(3) close eq3_t3m for %l t12m t10y t30y equation eq3_{%l}.ls(n,p) d{%l} c dt3m dtar_lg dtar_sm eq3_{%l}.wald(p) c(3)=c(4) close eq3_{%l} next ' ' ' ~~~~ Data and estimation of Equation #4 (Table 5) ~~~~ series ddr ddr=d(dr) series dtar_nodr dtar_nodr=dtar*((abs(dtar)>0) and (ddr=0)) series dtar_dr dtar_dr=dtar*((abs(dtar)>0) and (abs(ddr)>0)) ' equation eq4_t3m.ls(n,p) dt3m c dtar_dr dtar_nodr eq4_t3m.wald(p) c(2)=c(3) close eq4_t3m for %m t12m t10y t30y equation eq4_{%m}.ls(n,p) d{%m} c dt3m dtar_dr dtar_nodr eq4_{%m}.wald(p) c(3)=c(4) close eq4_{%m} next ' ' ' ~~~~ Data and estimation of Equation #5 (Table 6) ~~~~ series dtar_drlg dtar_drlg=dtar*((abs(ddr)>0) and (abs(dtar)>.25)) series dtar_drsm dtar_drsm=dtar*((abs(ddr)>0) and (abs(dtar)=.25)) smpl full if abs(dtar)>0 print date dtar ddr dtar_drlg dtar_drsm dtar_nodr smpl full ' equation eq5_t3m.ls(n,p) dt3m c dtar_drlg dtar_drsm dtar_nodr eq5_t3m.wald(p) c(2)=c(4) close eq5_t3m for %m t12m t10y t30y equation eq5_{%m}.ls(n,p) d{%m} c dt3m dtar_drlg dtar_drsm dtar_nodr eq5_{%m}.wald(p) c(3)=c(5) close eq5_{%m} next ' ' ' ~~~~ Data and estimation of Equation #6 (Table 7) ~~~~ smpl extend series dtar_nd series dtar_sd dtar_nd=dtar*(dum_nd=1) dtar_sd=dtar*(dum_nd=0) ' ' ~~~~ Full Sample (Oct 2, 1989 - Dec 31, 1997) ~~~~ smpl full equation eq6a_t3m.ls(n,p) dt3m c dtar_nd dtar_sd eq6a_t3m.wald(p) c(2)=c(3) close eq6a_t3m for %p t12m t10y t30y equation eq6a_{%p}.ls(n,p) d{%p} c dt3m dtar_nd dtar_sd eq6a_{%p}.wald(p) c(3)=c(4) close eq6a_{%p} next ' ' ~~~~ Extended Sample (Mar 1, 1984 - Dec 31, 1997): Footnote #14 ~~~~ smpl extend equation eq6b_t3m.ls(n,p) dt3m c dtar_nd dtar_sd eq6b_t3m.wald(p) c(2)=c(3) close eq6b_t3m for %o t12m t10y t30y equation eq6b_{%o}.ls(n,p) d{%o} c dt3m dtar_nd dtar_sd eq6b_{%o}.wald(p) c(3)=c(4) close eq6b_{%o} next ' ' ' ~~~~ Data and estimation of Equation A.1 (Table A.1) ~~~~ smpl entire series dt3m_lg dt3m_lg=dt3m*(abs(dt3m)>2*@stdev(dt3m)) smpl appenda if (abs(dt3m_lg)>0) freeze(hist_a) dt3m_lg.hist(p) smpl appendb if (abs(dt3m_lg)>0) freeze(hist_b) dt3m_lg.hist(p) ' ' ~~~~ Set sample to August 11, 1987 - December 31, 1997 smpl appendb equation eqa1b_t10y.ls(n,p) dt10y c dt3m dt3m_lg equation eqa1b_t30y.ls(n,p) dt30y c dt3m dt3m_lg ' ' ~~~~ Set sample to October 6, 1982 - August 10, 1987 smpl appenda equation eqa1a_t10y.ls(n,p) dt10y c dt3m dt3m_lg equation eqa1a_t30y.ls(n,p) dt30y c dt3m dt3m_lg ' ' ' ~~~~ Data and estimation of Equation A.2 (Table A.2) ~~~~ smpl appendb series dt3m_lgntc dt3m_lgntc=dt3m*(abs(dt3m)>2*@stdev(dt3m) and dtar=0) series dt3m_tc dt3m_tc=dt3m*(abs(dtar)>0) ' equation eqa2_t10y.ls(n,p) dt10y c dt3m dt3m_lgntc dt3m_tc eqa2_t10y.wald(p) c(3)=c(4) close eqa2_t10y equation eqa2_t30y.ls(n,p) dt30y c dt3m dt3m_lgntc dt3m_tc eqa2_t30y.wald(p) c(3)=c(4) close eqa2_t30y ' ' ' ' ~~~~ Target Changes and Discount Rate Changes ~~~~ smpl full if abs(dtar)>0 group changes date dtar ddr type print changes ' smpl full ' ' ' ~~~~ Save Final Results into Eviews workfile ~~~~ 'save d:\dan\market_reaction\mkt_react_wresults.wf1 ' ' 'output off --------------------------------------------------------------------- End of EViews Program --------------------------------------------------------------------- --------------------------------------------------------------------- Start of SAS Program --------------------------------------------------------------------- /* SERVO:~/dan/market_reaction/montecarlo.sas This program performs a MonteCarlo simulation for the Dan''s paper, "Tests of the Market''s Reaction to Federal Funds Rate Target Changes". The simulation randomly selects (with replacement) non-target change observations of the absolute change in the 3-month and 12-month T-Bill rate, fills a matrix of a specified sample size (&smplsz), calculates and outputs the mean and median. */ %let sims=10000; /* Number of simulations */ %let smplsz=32; /* Sample Size */ options nocenter ps=59; libname sds '~/dan/market_reaction/'; /* read in original dataset */ data work; set sds.m_react; adt10y=abs(dif(t10y)); adt30y=abs(dif(t30y)); dtar=dif(fftar); if sasdate ge '02oct1989'd; if dtar=0; run; proc print; var sasdate fftar dtar t10y adt10y t30y adt30y; run cancel; /* use iml to perform monte carlo simulation */ proc iml; use work; read all var{sasdate adt10y adt30y} into actual; do x=1 to &sims; a=j(&smplsz,2,.); select=j(&smplsz,2,.); do i=1 to &smplsz; select[i,1]=round(ranuni(-1)*nrow(actual)+0.5,1); select[i,2]=round(ranuni(-8)*nrow(actual)+0.5,1); a[i,1]=actual[select[i,1],2]; a[i,2]=actual[select[i,2],3]; end; *print select a; med=median(a); mean=j(1,2,.); mean[1,1]=sum(a[1:nrow(a),1])/nrow(a); mean[1,2]=sum(a[1:nrow(a),2])/nrow(a); stats=mean||med; *print stats; if x=1 then do; create output from stats[colname={t10y_mn t30y_mn t10y_md t30y_md}]; end; append from stats; free / actual x output; end; quit; run; proc sort data=output(keep=t10y_mn) out=t10y_mns; by descending t10y_mn; run; proc sort data=output(keep=t30y_mn) out=t30y_mns; by descending t30y_mn; run; proc sort data=output(keep=t10y_md) out=t10y_mds; by descending t10y_md; run; proc sort data=output(keep=t30y_md) out=t30y_mds; by descending t30y_md; run; data results; set t10y_mns; set t30y_mns; set t10y_mds; set t30y_mds; count+1; if count = &sims*.01 or count=&sims*.05 or count=&sims*.10; run; proc print data=results noobs; title1 "--- MonteCarlo Simulation ---"; title2 "Simulations: &sims"; title3 "Sample size: &smplsz"; title4 "1%,5% & 10% Critical Values"; title5 "for mean and median values"; var count t10y_mn t10y_md t30y_mn t30y_md; run; --------------------------------------------------------------------- End of SAS Program ---------------------------------------------------------------------