Page 1 of 2

three-dimensional panel data

Posted: Fri May 18, 2012 8:26 am
by laura
hey,

I'd like to estimate an OLS using three-dimensional panel data: investment in country i in industry j in year t is the dependant variable, independant variables are on a three-dimensional level (companies in country i industry j and year t), on a two dimesional level (GDP in country i in year t) and on a one-dimensional level ( overall state of the economy in year t). I figured out how to use panel data for two dimensions (it or jt) but I don't get how I can combine them into a i,j,t dimensional format, in order to estimate a fixed effects model distinguishing between industry and country.
Thanks in advance!

Re: three-dimensional panel data

Posted: Fri May 18, 2012 9:26 am
by EViews Gareth
EViews doesn't have automatic fixed effects for panels with more than 2 dimensions. However, you could always use @expand(country) and @expand(industry, @dropfirst) as regressors to make fixed effects manually.

Re: three-dimensional panel data

Posted: Mon Feb 18, 2013 5:01 pm
by jasonrobards
A 3d panel question. Have bilateral trade data by year, by commodity (ex: Russia wheat exports to Ukraine over time, Russia wheat export to US over time, Russia rice exports to Ukraine over time, Russia rice exports to US over time, etc.) I set up a panel data set in Eviews 5.1 with reporting country, partner country and commodity as x-section identifiers and year as date identifiers. Would like to generate variables that are combinations of commodities for bilateral country pairs over time. For example, (Russia wheat exports to Ukraine in 2000) + (Russia rice exports to Ukraine in 2000). Any guidance would be appreciated. Thanks.

Re: three-dimensional panel data

Posted: Wed Jun 19, 2013 6:43 am
by msh
EViews doesn't have automatic fixed effects for panels with more than 2 dimensions. However, you could always use @expand(country) and @expand(industry, @dropfirst) as regressors to make fixed effects manually.
I have a similar issue and encountered several posts stating that the fixed effects of the 3rd dimensions cannot be analyzed by eviews automatically. I understand the @expand function but I don't know how the dummies that I obtain exactly enable me to create the fixed effects manually. This is probably trivial to experienced economotricians and eviews users but unfortunately, I am only a beginner.

I would therefore very much appreciate if someone could tell me how the fixed effects can be manually computed and then used for the overall panel estimation.

Thanks a lot in advance!

Re: three-dimensional panel data

Posted: Wed Jun 19, 2013 7:03 am
by EViews Gareth
Fixed effects are just cross-section dummies.

Re: three-dimensional panel data

Posted: Wed Jun 19, 2013 7:13 am
by msh
Thank you for your quick reply.

In other words, I just estimate the dummies for every country and every sector in my data set and add them as explanatory variables to my regression? I guess I need a dummy of every category for every time period of observation?

Re: three-dimensional panel data

Posted: Thu Feb 07, 2019 8:53 am
by eviewsaoa
Hi,

I have migration data for 231x231 countries, for a number of different time periods. These countries are categorised as "country of origin" and "country of destination".

I wanted to create a group of dummy variables on country-pairs (f.e., US-UK, UK-US, NZL-UK, UK-NZL, etc.). In other words, I'm trying to include country-pair fixed effects. For that, I've done the following:

Code: Select all

group dumpair @expand(country_o,country_d,@dropfirst)
... where country_o is the country of origin; and country_d is the country of destination. However, as soon as I run that code line, Eviews stops responding (the Eviews version I'm using is 9.5). Could assistance be provided please?

Many thanks,

A.

Re: three-dimensional panel data

Posted: Thu Feb 07, 2019 1:12 pm
by startz
You're asking for 40,000+ dummies. Even if EViews can handle that, it's going to take a very, very long time.

Re: three-dimensional panel data

Posted: Fri Feb 08, 2019 2:16 am
by eviewsaoa
Exactly, I'm aware it's plenty of dummies. I wouldn't mind waiting, but it's just that Eviews stops responding and automatically closes. The computer I'm working on is quite powerful, so I don't think that should be an issue... That's why I was wondering whether there was an alternative to this (e.g., a loop) that might mitigate this problem.

Many thanks,

A.

Re: three-dimensional panel data

Posted: Fri Feb 08, 2019 12:20 pm
by startz
EViews shouldn't crash, but you do have a really big problem. Just storing the necessary cross-product matrix takes 19GB of memory for a regression, although it sounds like you are getting a crash before that stage.

Assuming you have enough data (i.e. 50,000 or so observations) and that you want to estimate a linear regression, you can use a loop doing what's called "sweeping out the dummies." It might be slow and might be a bit of a pain to program, but it should be doable.

Re: three-dimensional panel data

Posted: Tue Feb 26, 2019 9:00 am
by eviewsaoa
Thanks Startz. Is there an easier way to include id-pair dummy variables? In particular, I'm estimating a gravity model on bilateral migration flows. For that, I need to include country-pair fixed effects. My model is non-linear, the estimation method is GMM, Poisson family, log-link.

Thanks,

A.

Re: three-dimensional panel data

Posted: Tue Feb 26, 2019 12:25 pm
by startz
I don't think there is an easier way in a nonlinear model, although I may have forgotten something.

Re: three-dimensional panel data

Posted: Wed Feb 27, 2019 2:38 am
by eviewsaoa
Is there any way that you can look further into this please? It’s essential to our work and it will mean having to move platform for multiple users if it can’t be done in Eviews.

Re: three-dimensional panel data

Posted: Wed Feb 27, 2019 11:58 am
by startz
Perhaps the EViews staff has some suggestions, but I suspect this isn't really a software issue. I think you are going to find it hard to do this in any software. Also, my memory is that in a nonlinear model you will need a large number of observations per country pair in order to get consistency. That's an econometric rather than a software issue.

Re: three-dimensional panel data

Posted: Thu Feb 28, 2019 3:47 am
by eviewsaoa
I'll phrase the doubt differently. I'm not specifically interested in getting the values of the country-pair dummies, but I do want them to be included in my regression (i.e., I want the coefficients to be conditional on these pair-fixed effects). This is something really common when using this type of techniques, so I'm not really asking for any econometric doubt. My dataset is large enough to be able to do this in a consistent manner, and I do know another software that is capable of doing this really easily. But I want to stick to Eviews.