****************************************************************************************** * RATS 6.02 program of the paper by Chinn, Ferrara and Mignon (NBER WP, 2013) * "Post-recession US employment through the lens of a non-linear Okun's law" * * Code for : * 1/ Estimation of a Smooth-Transition Error Correction Model (ST-ECM) * between log-GDP and log-Employment over 1950q1-2007q4. * 2/ Conditional Forecasts of log-Employment based on this ST-ECM from 2008q1 to 2012q3. * * by L. Ferrara, April 2013 (laurent.ferrara@u-paris10.fr) ****************************************************************************************** * Data Import - Data are in log-levels from 1950q1 to 2012q3 cal 1950 1 4 all 2012:04 open data 'Data_ChinnFerraraMignon_WP_13.xls' data(for=xls,org=obs) / table pri / lemp lgdp * Graph of data spgra(vfie=2) gra(header='log-GDP'); #lgdp gra(header='log-employment'); #lemp spgra(done) * OLS estimation of the long-term equation of the ST-ECM until 2007q4 linreg lemp * 2007:04 res07 #constant lgdp * Analysis of residuals gra(min=-0.10, max=0.06); # res07 pri / res07 sta res07 * Estimation of the short-term non-linear equation of the ST-ECM until 2007q4 * Specification of the transition variable set dlgdp = lgdp-lgdp{1} set dlemp = lemp - lemp{1} set trans = 0.5*(dlgdp{2}+dlgdp{3}) gra; # trans sta trans * Initial values of parameters com alpha0 = 0.0, alpha1 = 0.0, alpha2 = 0.0, alpha3 = 0.0, alpha4 = 0.0 com beta0 = 0.0, beta1 = 0.0, beta2 = 0.0, beta3 = 0.0, beta4 = 0.0 com gamma = 7.76, threshold = -0.0010 * Declaration of parameters nonlin alpha0 alpha1 alpha2 alpha3 alpha4 beta0 beta1 beta2 beta3 beta4 gamma threshold * Estimation of parameters using non-linear least-squares frml mm = alpha0+alpha1*dlemp{1}+alpha2*dlgdp+alpha3*dlgdp{1}+alpha4*res07{1}+(beta0+beta1*dlemp{1}+beta2*dlgdp+beta3*dlgdp{1}+beta4*res07{1})*1/(1+exp(-gamma*(trans-threshold)/0.0080)) nlls(frml=mm) dlemp 1950:02 2007:04 ut param * Computation of the estimated transition function set ghat = 1-1/(1+exp(-param(11)*(trans-param(12))/0.0080)) * Graph of the estimated transition function, as well as the recession phases as stated by the NBER Dating Committee set nber = t>=1953:03.and.t<=1954:02.or.t>=1957:04.and.t<=1958:02.or.t>=1960:03.and.t<=1961:01.or.$ t>=1970:01.and.t<=1970:04.or.t>=1974:01.and.t<=1975:01.or.t>=1980:02.and.t<=1980:03.or.t>=1981:04.and.t<=1982:04.or.$ t>=1990:04.and.t<=1991:01.or.t>=2001:02.and.t<=2001:04.or.t>=2008:01.and.t<=2009:02 gra(shaded=nber,hea='Estimated transition function'); #ghat 1950:01 2007:04 * Computation of conditional Forecasts of log-employment from 2008q1 to 2012q3 set lcondpred 2007:03 2007:04 = lemp set lcondpred 2008:01 2012:03 = lcondpred{1}+param(1)+param(2)*(lcondpred{1}-lcondpred{2})+param(3)*dlgdp+param(4)*dlgdp{1}+param(5)*(lcondpred{1}-5.8501-0.6155*lgdp{1})+$ (param(6)+param(7)*(lcondpred{1}-lcondpred{2})+param(8)*dlgdp+param(9)*dlgdp{1}+param(10)*(lcondpred{1}-5.8501-0.6155*lgdp{1}))*1/(1+exp(-param(11)*(trans-param(12))/0.0080)) * Graph of conditional Forecasts of log-employment from 2008q1 to 2012q3 gra(key=lor) 2;#lemp 2007:01 2012:03;# lcondpred pri 2007:04 2012:03 lemp lcondpred * Average loss since the exit of the recession set diffst = lemp-lcondpred pri / diffst sta diffst 2009:03 2012:03 dis 'Average loss is equal to:' %mean*100 '%' * Export of condtional forecasts to Excel for comparison with other models open copy 'Results_CondPred_STECM.xls' COPY(format=xls,org=obs,HEADER=0,dates) 2007:04 2012:03 lemp lcondpred