This is the program file for Christopher J. Neely's article "The Federal Reserve Responds to Crises: September 11th Was Not the First." in the March/April 2004 issue of the Federal Reserve Bank of St. Louis Review. It creates the all of the data for figure 2 as well as the data for the "Funds Rate" panels of figures 3-5. /*--------------------------------------------------------------------------------*/ /*--------------------------------MAKE2.PRG---------------------------------------*/ /*--------------------------------------------------------------------------------*/ /* Program written: September 2002 Program for: Neely, Christopher J. "The Federal Reserve Responds to Crises: September 11th Was Not the First." Federal Reserve Bank of St. Louis Review, March/April 2004, 86(2), pp.27-42. Program written in: Gauss 6.0 This program puts together a realtime dataset of inflation and output gap based on the Philadelphia Realtime Dataset. Real-time potential output is estimated using a linear trend on the log of output with a "kink" in 1972. The input files are the quarterly files from the Philadelphia Realtime dataset (data by vintage, core variables/quarterly observations/quarterly vintages - www.phil.frb.org/econ/forecast/readow.html). The output file, make2.txt, is used in taylorrule.prg to create a daily series of Taylor Rule values. */ new; library pgraph; format /rd 10,3; yy = seqa(75,1,28); //go through 2003 yy = yy - 100*(yy.>=100); month = "feb"|"may"|"aug"|"nov"; my = vecr(0 $+ month' $+ ftocv(yy,2,0)); yy2003=3; my2=vecr(0 $+ month[1:2,.]' $+ ftocv(yy2003,2,0)); //but only to Feb 2003 my=my|my2; realtimedata = miss(zeros(rows(my),4),0); @ Year, Quarter, Inflation, Output Gap@ @Open each real time file and get data on Nominal output and Real output@ t = 1; do while t <= rows(my); fullname = "D:\\1Work\\Neely\\Data\\RealTime\\" $+ my[t] $+ ".wk1"; data = spreadsheetreadm(fullname,"A1:C400",1); data = data[.,1:3]; @Get Date, Nominal Output, Real Output@ data[.,2:3] = missex(data[.,2:3],data[.,2:3] .< -1000000000000~-10000000000000); data = packr(data); @Put dates in YYYY QQ format@ d = rows(data); datemat = miss(zeros(d,2),0); j = 1; do while j <= rows(data); tempyy = stof(strsect(data[j,1],1,4)); tempqq = stof(strsect(data[j,1],6,2)); datemat[j,.] = tempyy~tempqq; j = j + 1; endo; realgdp=data[.,3]; @Real Output@ gdpdef=(data[.,2]./data[.,3])*100; @GDP deflator@ @Estimate potential output based on log of output and linear trend@ y=ln(realgdp); @Log of output@ @Matrix of regressors: a constant, dummy for post1972, timetrend, dummy*timetrend@ year=datemat[.,1]; post1972=zeros(rows(datemat),1); i=1; do while i<=rows(post1972); if year[i].>1972; post1972[i]=1; endif; i=i+1; endo; trend=seqa(1,1,rows(y)); x=ones(rows(y),1)~post1972~trend~post1972.*trend; b=inv(x'x)*x'y; @Coefficients@ yhat=x*b; @Predicted log output values or log of potential output@ infl = 100*(gdpdef./lagn(gdpdef,4) - 1); @GDP Deflator Inflation@ outputgap=y-yhat; @Output Gap@ @Choose last observation and add to real-time dataset@ realtimedata[t,.] = datemat[d,.]~infl[d,.]~outputgap[d,.]; @yyyy,qq, Inflation, Output Gap@ t = t + 1; endo; @Put dates in YYQ format and choose data beginning with 1975:1@ newdate=((realtimedata[.,1]-1900)*10)+realtimedata[.,2]; realtimedata=newdate~realtimedata[.,3:4]; realtimedata=selif(realtimedata,realtimedata[.,1].>=751); /*---------- Output real time data ------------------*/ output file="D:\1Work\Neely\Data\make2.txt" reset; " @date infl outputgap@"; realtimedata; output off; /*--------------------------------------------------------------------------------*/ /*----------------------------TAYLORRULE.PRG--------------------------------------*/ /*--------------------------------------------------------------------------------*/ /* Program written: September 2002 Program for: Neely, Christopher J. "The Federal Reserve Responds to Crises: September 11th Was Not the First." Federal Reserve Bank of St. Louis Review, March/April 2004, 86(2), pp.27-42. Program written in: Gauss 6.0 This program uses real time data to create daily Taylor rule series for 0,2, and 4 inflation targets for Figures 2,3,4,5. The input files are make2.txt and the "Figure 2to5 Daily Fed Funds" (which is referred to in this program as ffrates.xls) sheet of the corresponding data file. The output files are taylorrule.xls and taylorrule.dat. */ /*------ Estimate a Quarterly Taylor Rule ----------*/ /* YYQ, inflation, outputgap*/ load data[] = D:\1Work\Neely\Data\make2.txt; data = reshape(data,rows(data)/3,3); data = miss(data,-999); yy = trunc(data[.,1]/10); q = (data[.,1] - 10*yy - 1)/4; datz = 1900 + yy + q; infl=data[.,2]; outputgap=data[.,3]; inflstar = 0~2~4; const = 2.5; /*Estimate Taylor Rule values for 0,2,4 inflation targets*/ ffstar = const + infl + .5*(infl - inflstar) + 100*outputgap/2; /*---- Interpolate to daily data -----------*/ fullnames = "D:\\1Work\\Neely\\Data\\ffrates.xls"; targdata = spreadsheetreadm(fullnames,"A10:B5150",1); yyyymmdd = targdata[.,1]; yy = trunc(yyyymmdd./10000) - 1900; mm = trunc(yyyymmdd./100) - 190000 - 100*yy; qq = ceil(mm./3); yearquarter = 10*yy + qq; indx = indnv(yearquarter,data[.,1]); locats = packr(seqa(1,1,rows(indx))~indx); locats = locats[.,1]; dailyffstar = miss(zeros(rows(yyyymmdd),3),0); dailyffstar[locats,.] = ffstar[packr(indx),.]; outdata = yyyymmdd~targdata[.,2]~dailyffstar; outdata = delif(outdata,yyyymmdd .> 20030331); let vnames = YYYYMMDD FFTarg FFstar0 FFstar2 FFstar4; z1 = saved(outdata,"D:\\1Work\\Neely\\Data\\taylorrule",vnames); z1; z2 = spreadsheetwrite(outdata,"D:\\1Work\\Neely\\Data\\taylorrule.xls","A1",1); z2; /*--------------------------------------------------------------------------------*/ /*----------------------------REVISIONS.PRG---------------------------------------*/ /*--------------------------------------------------------------------------------*/ /* Program written: September 2002 Program for: Neely, Christopher J. "The Federal Reserve Responds to Crises: September 11th Was Not the First." Federal Reserve Bank of St. Louis Review, March/April 2004, 86(2), pp.27-42. Program written in: Gauss 6.0 This program uses latest revised data (8/2003) to create daily Taylor rule series for 0,2,4 inflation targets for the bottom panel of Figure 2. The input files are the "Figure 2 Bottom Panel" (which is referred to in this program as latest_revisions.xls) and the "Figure 2to5 Daily Fed Funds" (which is referred to in this program as ffrates.xls) sheets of the corresponding data file. The output files are dailyfftarglatest.xls and dailyfftarglatest.dat. */ /*------ Estimate a Quarterly Taylor Rule ----------*/ /* YYQ, Real Pot GDP, Real GDP, GDP Deflator, PCE */ new; fullname = "D:\\1Work\\Neely\\Data\\latest_revisions.xls"; data = spreadsheetreadm(fullname,"A10:E150",1); data = data[.,1:5]; @Get Date, Real Pot GDP, Real GDP, GDP Deflator, PCE@ data = miss(data,-999); yy = trunc(data[.,1]/10); q = (data[.,1] - 10*yy - 1)/4; datz = 1900 + yy + q; yp = ln(data[.,2]); @ Potential Real GDP @ y = ln(data[.,3]); @ Real GDP @ infl = 100*(data[.,4]./lagn(data[.,4],4) - 1); @GDP Deflator Inflation@ @infl=inf[.,2]; Use this if you splice inflation@ inflstar = 0~2~4; const = 2.5; ffstar = const + infl + .5*(infl - inflstar) + 100*(y - yp)/2; /*---- Interpolate to daily data -----------*/ fullnames = "D:\\1Work\\Neely\\Data\\ffrates.xls"; targdata = spreadsheetreadm(fullnames,"A10:B5150",1); yyyymmdd = targdata[.,1]; yy = trunc(yyyymmdd./10000) - 1900; mm = trunc(yyyymmdd./100) - 190000 - 100*yy; qq = ceil(mm./3); yearquarter = 10*yy + qq; indx = indnv(yearquarter,data[.,1]); locats = packr(seqa(1,1,rows(indx))~indx); locats = locats[.,1]; dailyffstar = miss(zeros(rows(yyyymmdd),3),0); dailyffstar[locats,.] = ffstar[packr(indx),.]; outdata = yyyymmdd~targdata[.,2]~dailyffstar; outdata = delif(outdata,yyyymmdd .> 20030331); let vnames = YYYYMMDD FFTarg FFstar0 FFstar2 FFstar4; z1 = saved(outdata,"D:\\1Work\\Neely\\Data\\dailyfftarglatest",vnames); z1; z2 = spreadsheetwrite(outdata,"D:\\1Work\\Neely\\Data\\dailyfftarglatest.xls","A1",1); z2;