Page 1 of 2

Shrinkage IRFs with Panel Data

Posted: Mon Oct 03, 2016 4:54 am
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.

Re: Shrinkage IRFs with Panel Data

Posted: Mon Oct 03, 2016 8:05 am
by TomDoan
You have no data at all for country 71 (Syria) for real GDP. It also has a typo in the gap series.

Re: Shrinkage IRFs with Panel Data

Posted: Tue Oct 04, 2016 1:11 am
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!

Re: Shrinkage IRFs with Panel Data

Posted: Tue Oct 04, 2016 9:35 am
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.

Re: Shrinkage IRFs with Panel Data

Posted: Sat Dec 31, 2016 2:31 am
by TG81
Is there a way to label the impulse responses of some selected set of countries of interest in the same program? Thanks!

Re: Shrinkage IRFs with Panel Data

Posted: Sat Dec 31, 2016 1:33 pm
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.

Re: Shrinkage IRFs with Panel Data

Posted: Sun Jan 01, 2017 11:23 pm
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.

Re: Shrinkage IRFs with Panel Data

Posted: Mon Jan 02, 2017 5:52 pm
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.

Re: Shrinkage IRFs with Panel Data

Posted: Mon Jan 02, 2017 10:49 pm
by TG81
I will like to include and label only some selected countries. Will that be possible?

Re: Shrinkage IRFs with Panel Data

Posted: Tue Jan 03, 2017 7:38 pm
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)

Re: Shrinkage IRFs with Panel Data

Posted: Mon Jul 31, 2017 8:20 am
by TG81
Can we do VARX kind of estimation in the same set up where some variables are treated as exogenous variables? Please help.

Re: Shrinkage IRFs with Panel Data

Posted: Mon Jul 31, 2017 1:21 pm
by TomDoan
Yes, but you would have to figure out how the shrinkage prior would work with a VAR-X rather than a VAR.

Re: Shrinkage IRFs with Panel Data

Posted: Mon Jul 31, 2017 2:44 pm
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!

Re: Shrinkage IRFs with Panel Data

Posted: Mon Jul 31, 2017 2:49 pm
by TomDoan
Sorry, no.

Re: Shrinkage IRFs with Panel Data

Posted: Sun Jan 21, 2018 11:23 pm
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!