if "`1'"=="i"{local i "i"} /* in case of Monte-Carlo `i'="i" */
else local i "" /* normal case `i'is a blank */
set textsize 170
local g=1
while `g'<=$G { /* row variable - the one that is recepient of respone */
local j=1
while `j'<=$G { /* column variable - the one causing response */
if "`i'"=="i" { /* with errors */
format ${name`j'}_5 ${name`j'} ${name`j'}_95 %7.4f
gr ${name`j'}_5 ${name`j'} ${name`j'}_95 s if /* */ varname=="${name`g'}",saving(gr`g'_`j',replace) s(iii) c(lll) yli(0) /*
*/ b1("response of ${name`g'} to ${name`j'} shock")
}
else { /* without errors */
format ${name`j'} %7.4f
gr ${name`j'} s if varname=="${name`g'}",saving(gr`g'_`j',replace) s(i) c(l) yli(0) /*
*/ b1("response of ${name`g'} to ${name`j'} shock")
}
local grlist "`grlist' gr`g'_`j'" /* list of all graphs to put together */
local j=`j'+1
}
local g=`g'+1
}
set textsize 100
*if length(" Impulse-responses for $P lag VAR of $names ")>80 { set textsize 90}
if "`i'"=="i"{
local b2="b2(Errors are 5% on each side generated by Monte-Carlo with $maxi reps)"}
if "$if"~="" { local t2="t2(Sample : $if)"}
if length(" Impulse-responses for $P lag VAR of $names ")<80 {
gr using `grlist', t1( Impulse-responses for $P lag VAR of $names ) `t2' `b2'
}
else {
gr using `grlist', t1( $P lag VAR of $names ) `t2' `b2'
}
end
完整的程序请看,
Panel VAR code.rar(182.98 KB)