Detailed description
Example
This looks at the lag lengths picked using general-to-specific, AIC and SBC to examine the sensitivity to the criterion used.
Code: Select all
*
* Enders, Applied Econometric Time Series, 3rd edition
* Example from Section 5.13
* SVAR example
* Pages 344-347
*
open data realrates.xls
calendar(q) 1973:1
data(format=xls,org=columns) 1973:01 2008:02 e_can e_ja e_uk p_ca p_ja p_uk p_us
*
set loge_uk = log(e_uk)
set logr_uk = loge_uk-log(p_uk)+log(p_us)
set dloge_uk = loge_uk-loge_uk{1}
set dlogr_uk = logr_uk-logr_uk{1}
*
linreg dloge_uk
# constant loge_uk{1} dloge_uk{1}
*
* The Elliott-Rothenberg-Stock test can be done using the ERSTEST
* procedure. The DF t statistic is the DFGLS value in the output.
*
@erstest(lags=1) loge_uk
*
* The VARLAGSELECT procedure can help choose the lag length. This does
* general-to-specific, which involves block likelihood ratio tests of
* the final lag.
*
@varlagselect(crit=gtos,lags=8)
# dlogr_uk dloge_uk
@varlagselect(crit=aic,lags=8)
# dlogr_uk dloge_uk
@varlagselect(crit=sbc,lags=8)
# dlogr_uk dloge_uk
*
system(model=xrates)
variables dlogr_uk dloge_uk
lags 1
det constant
end(system)
*
estimate
errors(model=xrates,steps=8)
errors(model=xrates,factor=%bqfactor(%sigma,%varlagsums),steps=8,labels=||"Real","Nominal"||)