* * Example 9.2.2, pp 412-414 * ?? beta equations don't match * calendar(m) 1976 * * Read the return data * open data m-fac9003.txt data(format=free,org=columns) 1990:1 2003:12 aa age cat f fdx gm hpq kmb mel nyt pg trb txn sp * dec vect[strings] vl(13) ewise vl(i)=%l(i) * * Read the macro data over the longer time span * open data m-cpice16-dp7503.txt data(format=free,org=columns) 1976:1 2003:12 cpi cen * * @VARLagSelect(crit=bic,lags=13) # cpi cen * sweep(series=rvar) # cpi cen # cpi{1 to 3} cen{1 to 3} constant * sweep # aa to txn # constant compute covexcess=%sigma * sweep(coeffs=cmf) # aa to txn # constant rvar(1) rvar(2) * compute [vector] betacpi =tr(%xrow(cmf,2)) compute [vector] betace16 =tr(%xrow(cmf,3)) compute [vector] sigmas =%sqrt(%xdiag(%sigma)*%nobs/(%nobs-3)) compute [vector] rsquareds=1.0-%xdiag(%sigma)./%xdiag(covexcess) * report(action=define) report(atcol=1,atrow=2,fillby=cols) vl report(atcol=2,atrow=1,fillby=cols) "beta cpi" betacpi report(atcol=3,atrow=1,fillby=cols) "beta ce16" betace16 report(atcol=4,atrow=1,fillby=cols) "r.square" rsquareds report(action=format,picture="*.###") report(action=show)