Notice: On April 23, 2014, Statalist moved from an email list to a forum, based at statalist.org.

# Re: st: Blanchard Quah Decomposition

 From Jorge Eduardo Pérez Pérez To "statalist@hsphsun2.harvard.edu" Subject Re: st: Blanchard Quah Decomposition Date Mon, 7 May 2012 14:04:01 -0400

```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 means_from_gnp

* Remove a linear trend from unemployment
gen trend=_n
reg lhmur trend
predict trend_from_ur

matrix c=(.,0\.,.)

* Get structural shocks
matrix B=e(B)
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
replace F1=F1+means_from_gnp
replace F1=sum(F1)*0.01
sum date if e(sample)
local a=r(min)-1
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
> 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.
>
> 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/
```