* 24 Oct 98 * program to calculate stage 1 VAR--Japan demand system * cal 1971 1 4 * all 70 1998:4 * open data d:\imf\varjapan\rats.wks data(format=wks,org=obs) / * smpl 1973:1 1998:4 * system 1 to 8 variables \$ dlc dlx dlm dlfixr dlrest dlg invenr dlpubi lags 1 to 2 det constant end(system) declare vect[series] varresids(8) estimate(ftests) / varresids(1) * set rc = varresids(1) set rx = varresids(2) set rm = varresids(3) set rfix = varresids(4) set rrest = varresids(5) set rg = varresids(6) set rinvenr = varresids(7) set rpubi = varresids(8) * set rgdp = cr*rc+fixrr*rfix+restr*rrest+ \$ xr*rx-mr*rm+gr*rg+rinvenr+pubir*rpubi * * * * Calculating accumulated residuals of gdp, c, fixr compute start1=1990:2, end1=1998:4 smpl start1 end1;set(first=1) t1 = t1{1}+1 smpl 1973:1 1998:4 * * * accumulated residuals of government spending stat(noprint) rg;compute vtmp=%variance;set rg_s = rg/sqrt(vtmp) acc rg_s start1 end1 rg_st1 * * *Use of instrumental variables to isolate shocks to individual variables * ** consumption instrument constant rg rx linreg(inst,noprint) rc / ec # constant rgdp stat(noprint) ec;compute vtmp=%variance;set ec_s = ec/sqrt(vtmp) acc ec_s start1 end1 ec_st1 ** investments instrument constant rg rx linreg(inst,noprint) rinvenr / eivenr # constant rgdp stat(noprint) eivenr;compute vtmp=%variance;set eivenr_s = eivenr/sqrt(vtmp) acc eivenr_s start1 end1 eivenr_st1 instrument constant rg rx linreg(inst,noprint) rfix / efix # constant rgdp stat(noprint) efix;compute vtmp=%variance;set efix_s = efix/sqrt(vtmp) acc efix_s start1 end1 efix_st1 instrument constant rg rx linreg(inst,noprint) rrest / erest # constant rgdp stat(noprint) erest;compute vtmp=%variance;set erest_s = erest/sqrt(vtmp) acc erest_s start1 end1 erest_st1 instrument constant rg rx linreg(inst,noprint) rpubi / epubi # constant rgdp stat(noprint) epubi;compute vtmp=%variance;set epubi_s = epubi/sqrt(vtmp) acc epubi_s start1 end1 epubi_st1 **IMPORTS instrument constant rg rx linreg(inst,noprint) rm / em # constant rgdp stat(noprint) em;compute vtmp=%variance;set em_s = em/sqrt(vtmp) acc em_s start1 end1 em_st1 * * TRADE BALANCE set rxm = rx-em stat(noprint) rxm;compute vtmp=%variance;set rxm_s = rxm/sqrt(vtmp) acc rxm_s start1 end1 rxm_st1 * * * SUM OF GDP SHOCKS set egdp = cr*ec+fixrr*efix+restr*erest+ \$ xr*rx-mr*em+gr*rg+eivenr+pubir*epubi * stat(noprint) egdp;compute vtmp=%variance;set egdp_s = egdp/sqrt(vtmp) acc egdp_s start1 end1 egdp_st1 * * * print of residuals * "********************************************************" * " RESIDUALS ACCUMULATED FROM 1990:1 TO 1997:2 " * "********************************************************" print start1 end1 egdp_st1 ec_st1 print start1 end1 efix_st1 erest_st1 epubi_st1 print start1 end1 rxm_st1 rg_st1 eivenr_st1 open copy d:\imf\varjapan\final\residuals.wks copy(org=obs,format=wks,dates) / rg_s ec_s eivenr_s efix_s erest_s \$ epubi_s em_s rxm_s egdp_s ?? ?? (continued...) - 2 -