Notice: On April 23, 2014, Statalist moved from an email list to a forum, based at statalist.org.
From | James Windsor-Clive <jwindsorclive@googlemail.com> |
To | statalist@hsphsun2.harvard.edu |
Subject | Re: st: Blanchard Quah Decomposition |
Date | Mon, 7 May 2012 19:32:18 +0100 |
Thank you very much for that code, it should very useful. I am also looking to replicate figures (3)-(6) in the Blanchard and Quah paper. Do you have the code to create those figures? Kind regards James On Mon, May 7, 2012 at 7:04 PM, Jorge Eduardo Pérez Pérez <perez.jorge@ur.edu.co> wrote: > This code replicates Figure 8 of the Blanchard-Quah paper. I don't > know if there is an easier way to produce the structural shocks, I > created them manually. To use this code, you need the paper's dataset, > which is available here: > > http://www.estima.com/forum/viewtopic.php?f=4&t=304 > > ----------------------- > use "${dir}\datos\bqdata.dta" > tsset date > > gen loggnp=log(gnp) > gen loggd=log(gd87) > gen logrgnp=loggnp-loggd+log(100) > gen dlogrgnp=100*d.logrgnp > > * Extract separate means from the GNP growth series. Save the fitted > values for* rebuilding the data later. > > gen d1=(date<=tq(1973q4)) > gen d2=(date>tq(1973q4)) > > reg dlogrgnp d1 d2, nocons > predict gdpadjust, resid > predict means_from_gnp > > * gen gdpadjust=dlogrgnp > * Remove a linear trend from unemployment > gen trend=_n > reg lhmur trend > predict uradjust, resid > predict trend_from_ur > > matrix c=(.,0\.,.) > svar gdpadjust uradjust, lags(1/8) lreq(c) > > * Get structural shocks > matrix B=e(B) > predict e1, res eq(gdpadjust) > predict e2, res eq(uradjust) > mkmat e1 e2, matrix(e) > matrix eta=(inv(B)*e')' > svmat eta > * Zero out demand shocks and generate reduced form shocks again > replace eta2=0 > mkmat eta1 eta2, matrix(eta) > matrix e=B*eta' > * Generate forecast with zeroed out shocks > matrix A1=e(A1) > matrix F=(inv(A1)*e)' > svmat F > * Add means back > replace F1=F1+means_from_gnp > replace F1=sum(F1)*0.01 > sum date if e(sample) > local a=r(min)-1 > * Add initial values back > sum logrgnp if date==`a' > replace F1=F1+r(mean) > ren F1 bq_trend > gen bq_gap=logrgnp-bq_trend > * Figure 8 > tsline bq_gap if date>=tq(1950q1) > --------------------------- > > _______________________ > Jorge Eduardo Pérez Pérez > > > On Mon, May 7, 2012 at 1:11 PM, James Windsor-Clive > <jwindsorclive@googlemail.com> wrote: >> Dear Statalist users, >> >> Apologies if you have answered this already but I am a relative >> newcomer to Stata and this list. >> >> I have conducted an SVAR using long run restrictions to decompose >> temporary and permanent shocks. I am using the methodology of >> Blanchard and Quah: >> >> Olivier Jean Blanchard; Danny Quah >> "The Dynamic Effects of Aggregate Demand and Supply Disturbances" >> The American Economic Review, Vol. 79, No. 4. (Sep., 1989), pp. 655-673 >> >> I was wondering if there was a procedure on Stata that extracts the >> structural shock series from the estimated residual series. My aims is >> to manufacture impulse response functions showing the response of >> output to demand and supply shocks. Any guidance would be very much >> appreciated. >> >> Thanks in advance, >> James >> * >> * For searches and help try: >> * http://www.stata.com/help.cgi?search >> * http://www.stata.com/support/statalist/faq >> * http://www.ats.ucla.edu/stat/stata/ >> >> > > > * > * For searches and help try: > * http://www.stata.com/help.cgi?search > * http://www.stata.com/support/statalist/faq > * http://www.ats.ucla.edu/stat/stata/ * * For searches and help try: * http://www.stata.com/help.cgi?search * http://www.stata.com/support/statalist/faq * http://www.ats.ucla.edu/stat/stata/