Page 1 of 1

how to estimate the panel var model

Posted: Sun Sep 27, 2009 8:42 pm
by luxu1983
dear
how to estimate the panle var model
thanks a lot

Re: how to estimate the panel var model

Posted: Mon Sep 28, 2009 11:56 am
by TomDoan
Which panel VAR model?

Re: how to estimate the panel var model

Posted: Mon Sep 28, 2009 11:57 pm
by luxu1983
TomDoan wrote:Which panel VAR model?
yit=b*yit-1+eit
yit=(x1it,x2it)' ;b:coefficiences

Re: how to estimate the panel var model

Posted: Tue Sep 29, 2009 4:11 pm
by TomDoan
As you have that described, you can just read the data with a panel CALENDAR, and do a VAR the same way you would for regular time series data. The ESTIMATE instruction (and LINREG and most other instructions) respects the boundaries between individuals in a panel data set.

Re: how to estimate the panel var model

Posted: Wed Jun 17, 2015 3:06 pm
by luching
Hi Tom, Suppose, instead of using the panel calendar, I stack up the panel data as an artificial long time series and estimate the VAR. Is it the case that the main difference in my approach is the boundary? Also, if I use the panel calendar, how would one take care of fixed effects?

Re: how to estimate the panel var model

Posted: Wed Jun 17, 2015 3:39 pm
by TomDoan
luching wrote:Hi Tom, Suppose, instead of using the panel calendar, I stack up the panel data as an artificial long time series and estimate the VAR. Is it the case that the main difference in my approach is the boundary?
Correct. Unless you use a SMPL option to avoid it, one individual will lag back into the end of the previous individual.
luching wrote: Also, if I use the panel calendar, how would one take care of fixed effects?
That's a whole different matter because that's a dynamic model with fixed effects. For small T, big N, the method typically used is that from Holtz-Eakin, Newey and Rosen. With small N, big T, an obvious question is whether fixed coefficients across individuals are necessary/desirable. The Panel Data course has a chapter on Panel VAR's which includes both the fixed lag coefficients with fixed effects approach and use of shrinkage estimators to allow the lag coefficients to vary (somewhat) from individual to individual.

Re: how to estimate the panel var model

Posted: Thu Jun 25, 2015 1:40 pm
by luching
Hi Tom, I am trying to do a standard cholesky impulses using a panel VAR. I created the panel data using the pform command. It seems the impulses are sensitive to the ordering of the countries in the panel. Is it something wrong with the panel data I created. The relevant section of the code is as follows:

dec vec[string] varlabels(nvarall)
dec vec[ser] y(nvarall)
comp k = 0
dofor ser = GDP VIX
comp k = k+1
comp varlabels(k) = %l(ser)
pform(block=capt) y(k) 1 capt*ncoun
# ser
labels y(k)
# varlabels(k)
end
*
cal(q,panelobs=capt) 2001:1

Re: how to estimate the panel var model

Posted: Thu Jun 25, 2015 2:24 pm
by TomDoan
How are the input data structured? I'm not really understanding what the PFORM instruction is supposed to be doing here.

Re: how to estimate the panel var model

Posted: Thu Jun 25, 2015 3:07 pm
by luching
Each input series is a single column stacked by countries. That is:
GDP
ARG1980
ARG1981
ARG1982
ARG1983
...
ARG2012
CHL1980
CHL1981
CHL1982
CHL1983
...

Also, it seems after doing the "pform", if I were to tell RATS to estimate using the whole panel then the relevant sample is not 1980:2012, but 1980:1980*ncountries. This makes me suspect the panel is not constructed correctly.

Re: how to estimate the panel var model

Posted: Thu Jun 25, 2015 3:25 pm
by TomDoan
Isn't that annual, not quarterly? Assuming you have full blocks of 33 years per country, it looks like you just need

compute ncount=numberofcountries
cal(a,panelobs=33) 1980:1
data(options for reading data) 1//1980:1 ncount//2012:1 gdp vix

If the data are already properly blocked, you don't have to use PFORM---just set the panel-dated CALENDAR. PFORM is for handling data that aren't properly blocked.

Re: how to estimate the panel var model

Posted: Thu Jun 25, 2015 3:45 pm
by luching
Thanks Tom. This gave me the same panel structure as pform. When I copied out the panel, it does preserve the panel structure (dates repeat). But while estimating a VAR, it does not seem to recognize the sample size. For instance, if I restrict the estimation sample to 2001:1 2014:4, this seems to take only the data for the first country. And if want to include the entire panel I need to "extend" the estimation time period. That makes me suspect if the model estimation is taking into account the panel structure. If that is not the case and the estimation simply takes a "stacked" sample, the ordering of the countries will matter as I suspect. Please advise.

Re: how to estimate the panel var model

Posted: Thu Jun 25, 2015 4:16 pm
by TomDoan
See page UG-411 in the User's Guide for selecting samples in a panel data set.

Re: how to estimate the panel var model

Posted: Thu Jun 25, 2015 4:35 pm
by luching
Thanks. I see that without specifying the sample during estimation, it takes the full sample. But I am still trying to understand the more conceptual issue with regard to a panel VAR: if the ordering of countries matter while constructing the panel, then there seems to be something missing. Is this a fundamental issue with PVARs?

Re: how to estimate the panel var model

Posted: Thu Jun 25, 2015 6:21 pm
by luching
I think I found the problem. My panel is unbalanced and I used NA's to fill out some entries. Whenever the first entry is an NA, then there are some issues. Otherwise, it seems fine. The PVAR is no longer subject to ordering of countries. Many thanks Tom.