Allin and Jack,
this option is realy perfect!
Pls pls pls put it in the next version if it's not a problem (for VAR and
VECM) with a option to or not to save the dummies.
Automatically generates dummis....realy beautifull.
:))))
open data9-7
set echo off
# 3-equation VAR
myvar <- var 2 PRICE INCOME PRIME
# save residuals matrix and cross-equation residual
# variance matrix
matrix vresid = myvar.$uhat
matrix var_vcv = myvar.$vcv
# get per-equation standard errors
matrix vse = sqrt(diag(var_vcv))
# the VAR residuals have two missing observations at the
# start of the data; advance the sample start to skip
# them
smpl +2 ;
loop i=1..3 --quiet
# extract the columns of vresid as series
series uhat$i = vresid[,$i]
# extract the per-equation residual standard errors
scalar se = vse[$i]
# make standardized residuals series
series ustd$i = uhat$i / se
# make dummy series identifying "big" residuals
series ubig$i = abs(ustd$i) > 2.0
endloop
# print the residuals info in various forms
print uhat1 uhat2 uhat3 --byobs
print ustd1 ustd2 ustd3 --byobs
print ubig1 ubig2 ubig3 --byobs
# count big residuals per equation
loop i=1..3 --quiet
scalar cbig = sum(ubig$i)
printf "Equation $i has %d standardized residuals > 2.0\n", cbig
endloop
Allin Cottrell
_______________________________________________
Gretl-users mailing list
Gretl-users(a)ricardo.ecn.wfu.edu
http://ricardo.ecn.wfu.edu/mailman/listinfo/gretl-users
_________________________________________________________________
Be the first to hear what's new at MSN - sign up to our free newsletters!
http://www.msn.co.uk/newsletters