I would like to obtain the IRF with confidence bands for the univariate autoregressive model in panel data (my dataset comprises 21 countries and 38 observations but I want to estimate the model only for 17 countries).
I try to adapt to an equation in panel form the code posted by T. Doan (05/27/2011) :
Code: Select all
linreg(define=baseeqn) y
# y{1} dummy{0 1}
*
modify baseeqn yeqn
vreplace y with yboot
set yboot = y
equation(empty) dummyeqn dummy
group bimodel yeqn dummyeqn
*
compute ndraws=10000
compute nsteps=20
*
declare vect[rect] %%responses
*
dim %%responses(ndraws)
do draw=1,ndraws
uforecast(boot,equation=baseeqn) yboot
linreg(equation=yeqn,noprint)
impulse(model=bimodel,shocks=||0.0,1.0||,results=impulses,steps=nsteps,noprint)
dim %%responses(draw)(2,nsteps)
ewise %%responses(draw)(i,j)=ix=%vec(%xt(impulses,j)),ix(i)
end do draws
*
@mcgraphirf(model=bimodel,shocklabels=||"To Dummy"||,varlabels=||"Y"||,include=||1||)The equation and the variables are strictly the same, I just replaced
linreg(define=baseeqn) y; # y{1} dummy{0 1}
by
pregress(method=fixed,noprint,effects=both,smpl=panelsmpl,define=baseeqn) y; # y{ 2} dummy{0 1};
because I want to estimate my baseline panel model with both fixed effects and time effects.
Next, in the loop generating the draws I replaced
linreg(equation=yeqn,noprint)
by
pregress(method=fixed,noprint,effects=both,smpl=panelsmpl,equation=yeqn)
but it does not work. Maybe my way to adapt the original code to a panel equation is not correct.
I would like to know if anyone can help me to fix that point.
Thanks,
Best,
Romain
Ps: enclosed the RATS program and the database.