Shrinkage IRFs with Panel Data

Questions related to panel (pooled cross-section time series) data.
TG81
Posts: 23
Joined: Fri Oct 15, 2010 8:15 pm

Shrinkage IRFs with Panel Data

Unread post by TG81 »

I am attaching the file and the data. The data has been transformed into balanced panel using pform. Now I want to estimate to impulse responses of output due to a shock in gap in a panel of 79 countries. However, I am getting the following error message and not sure how to fix the problem.

"## SR10. Missing Values And/Or SMPL Options Leave No Usable Data Points
The Error Occurred At Location 81, Line 2 of loop/block"

Please help me resolve this issue.
Attachments
abc2.xls
Data
(111.5 KiB) Downloaded 1389 times
Estima Codes.RPF
Program
(4.53 KiB) Downloaded 1651 times
TomDoan
Posts: 7814
Joined: Wed Nov 01, 2006 4:36 pm

Re: Shrinkage IRFs with Panel Data

Unread post by TomDoan »

You have no data at all for country 71 (Syria) for real GDP. It also has a typo in the gap series.
TG81
Posts: 23
Joined: Fri Oct 15, 2010 8:15 pm

Re: Shrinkage IRFs with Panel Data

Unread post by TG81 »

If I remove Syria from the dataset such as there were not enough data points. Now the number of countries are 78, the VAR is estimated but with the the following error message
"## M1. number = 78 is Illegal. Value should be between 1 and 20
. The Error Occurred At Location 107, Line 3 of loop/block"

I am not sure why the value should be from 1 to 20. Can you please help me with this?

Thanks in advance!
TomDoan
Posts: 7814
Joined: Wed Nov 01, 2006 4:36 pm

Re: Shrinkage IRFs with Panel Data

Unread post by TomDoan »

If you do Edit-Show Last Error it will point you to the loop at the bottom that does the graphs. 20 is the limit on the number of series that can be graphed with a single GRAPH instruction prior to version 9.1. With 9.1, there is no longer any limit. The graph with the full set of 78 countries is attached. Obviously, the GDP to GDP (growth??) is fairly consistent, while the gender gap to GDP responses are all over the place.
Attachments
shrinkvar.pdf
Graph with all countries
(18.92 KiB) Downloaded 1312 times
TG81
Posts: 23
Joined: Fri Oct 15, 2010 8:15 pm

Re: Shrinkage IRFs with Panel Data

Unread post by TG81 »

Is there a way to label the impulse responses of some selected set of countries of interest in the same program? Thanks!
TomDoan
Posts: 7814
Joined: Wed Nov 01, 2006 4:36 pm

Re: Shrinkage IRFs with Panel Data

Unread post by TomDoan »

KEY=ATTACHED can be used to attach labels to the graphs. Whether there is room in one of those graphs to insert labels is another question.
TG81
Posts: 23
Joined: Fri Oct 15, 2010 8:15 pm

Re: Shrinkage IRFs with Panel Data

Unread post by TG81 »

Thanks for your reply! The instruction "key=attached" will provide labels for all the countries in the sample. That will indeed make the graph messy. If I am interested in responses of few selected countries, will it be possible to do that within the
program.
TomDoan
Posts: 7814
Joined: Wed Nov 01, 2006 4:36 pm

Re: Shrinkage IRFs with Panel Data

Unread post by TomDoan »

Are you just looking to label a few graphs (while keeping all of them), or are you looking to just include and label a few of the graphs? The first is still going to be a bit of a mess.
TG81
Posts: 23
Joined: Fri Oct 15, 2010 8:15 pm

Re: Shrinkage IRFs with Panel Data

Unread post by TG81 »

I will like to include and label only some selected countries. Will that be possible?
TomDoan
Posts: 7814
Joined: Wed Nov 01, 2006 4:36 pm

Re: Shrinkage IRFs with Panel Data

Unread post by TomDoan »

This pulls out 4 of the responses (for, in this case, countries 5, 10, 15 and 20). The attached labels still don't really work on two "own" responses where there isn't much of a difference.

Code: Select all

dec vect[int] selector
compute selector=||5,10,15,20||
compute nselect=%size(selector)
dec vect[string] lselector(nselect)
ewise lselector(i)=country(selector(i))
dec vect[rect[series]] irfselector(nselect)
do is=1,nselect
   compute i=selector(is)
   compute coeffsi=%xsubvec(bmeans,i*varsize+1,(i+1)*varsize)
   compute %modelsetcoeffs(varmodel,coeffsi)
   impulse(model=varmodel,results=irf(is),$
     cv=%identity(nvar),steps=24)
end do is
list iser = 1 to nselect
spgraph(vfields=nvar,hfields=nvar,footer="Shrinkage IRF's",$
  xlabels=longvars,ylabels=longvars)
do i=1,nvar
   do j=1,nvar
      graph(number=0,nodates,key=attached,klabels=lselector) %size(selector)
      cards irf(iser)(i,j)
   end do j
end do i
spgraph(done)
TG81
Posts: 23
Joined: Fri Oct 15, 2010 8:15 pm

Re: Shrinkage IRFs with Panel Data

Unread post by TG81 »

Can we do VARX kind of estimation in the same set up where some variables are treated as exogenous variables? Please help.
TomDoan
Posts: 7814
Joined: Wed Nov 01, 2006 4:36 pm

Re: Shrinkage IRFs with Panel Data

Unread post by TomDoan »

Yes, but you would have to figure out how the shrinkage prior would work with a VAR-X rather than a VAR.
TG81
Posts: 23
Joined: Fri Oct 15, 2010 8:15 pm

Re: Shrinkage IRFs with Panel Data

Unread post by TG81 »

Is there an example program that you can help me with which does Panel VARX kind of estimations using shrinkage priors or any other method? Thanks in advance!
TomDoan
Posts: 7814
Joined: Wed Nov 01, 2006 4:36 pm

Re: Shrinkage IRFs with Panel Data

Unread post by TomDoan »

Sorry, no.
TG81
Posts: 23
Joined: Fri Oct 15, 2010 8:15 pm

Re: Shrinkage IRFs with Panel Data

Unread post by TG81 »

I want to do 2 more things in the context of this model. I have been asked to find confidence bands for the impulse responses and variance decomposition for the model. Could you please help me with this? Thanks in advance!
Post Reply