*
* Martin, Hurn, Harris, "Econometric Modelling with Time Series"
* Examples 13-24, 13-25, 13-26, 13-27 from pp 492-500
* VAR Estimates of a U.S. Macroeconomic Model
*
open data sims_data.dat
calendar(m) 1959:1
data(format=prn,nolabels,org=columns) 1959:01 1998:12 ffunds exchrate commpri m1 cpi ip
*
set lex = log(exchrate)
set lcp = log(commpri)
set lm = log(m1)
set lp = log(cpi)
set lo = log(ip)
*
set r = ffunds
set mgrow = 100.0*(lm-lm{12})
set infl = 100.0*(lp-lp{12})
set ygrow = 100.0*(lo-lo{12})
*
system(model=var2)
variables r mgrow infl ygrow
lags 1 2
det constant
end(system)
*
estimate
disp "Log Likelihood (value in text is divided by T)" %logl
*
* Example 13.25 Causality tests
*
* Causality test statistics are included in the ESTIMATE output. Note
* that what are provided in the text are chi-squared while ESTIMATE uses
* the F form, so (with two degrees of freedom) the ESTIMATE ones are
* roughly half the size though the p-values should be almost identical
* given the high denominator degrees of freedom on the F.
*
* Example 13.26 Impulse responses
*
* The simple IMPULSE instruction below will (by default), do the
* Choleski factor in the order of listing on the VARIABLES instruction.
* This gives the same results as in the text, except the matrices are
* organized differently---reading across a row in the IMPULSE output is
* the same as reading down a column in the matrices in the text.
*
impulse(model=var2,steps=2,print)
*
* The variance decomposition done by ERRORS scales everything to sum to
* 100% for each variable and horizon. The text shows the values before
* doing that. For any row, if you square the standard error to get the
* forecast variance and multiply the table percentage by the
* variance/100, you'll get the values in the text.
*
errors(model=var2,steps=2)