three-dimensional panel data

For questions regarding the import, export and manipulation of data in EViews, including graphing and basic statistics.

Moderators: EViews Gareth, EViews Jason, EViews Steve, EViews Moderator

laura
Posts: 1
Joined: Fri May 18, 2012 8:15 am

three-dimensional panel data

Postby laura » Fri May 18, 2012 8:26 am

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!

EViews Gareth
Fe ddaethom, fe welon, fe amcangyfrifon
Posts: 13306
Joined: Tue Sep 16, 2008 5:38 pm

Re: three-dimensional panel data

Postby EViews Gareth » Fri May 18, 2012 9:26 am

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.
Follow us on Twitter @IHSEViews

jasonrobards
Posts: 3
Joined: Mon Nov 12, 2012 7:33 pm

Re: three-dimensional panel data

Postby jasonrobards » Mon Feb 18, 2013 5:01 pm

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.

msh
Posts: 2
Joined: Wed Jun 19, 2013 6:26 am

Re: three-dimensional panel data

Postby msh » Wed Jun 19, 2013 6:43 am

EViews Gareth wrote: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!

EViews Gareth
Fe ddaethom, fe welon, fe amcangyfrifon
Posts: 13306
Joined: Tue Sep 16, 2008 5:38 pm

Re: three-dimensional panel data

Postby EViews Gareth » Wed Jun 19, 2013 7:03 am

Fixed effects are just cross-section dummies.
Follow us on Twitter @IHSEViews

msh
Posts: 2
Joined: Wed Jun 19, 2013 6:26 am

Re: three-dimensional panel data

Postby msh » Wed Jun 19, 2013 7:13 am

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?

eviewsaoa
Posts: 7
Joined: Tue Jul 17, 2018 7:59 am

Re: three-dimensional panel data

Postby eviewsaoa » Thu Feb 07, 2019 8:53 am

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.

startz
Non-normality and collinearity are NOT problems!
Posts: 3775
Joined: Wed Sep 17, 2008 2:25 pm

Re: three-dimensional panel data

Postby startz » Thu Feb 07, 2019 1:12 pm

You're asking for 40,000+ dummies. Even if EViews can handle that, it's going to take a very, very long time.

eviewsaoa
Posts: 7
Joined: Tue Jul 17, 2018 7:59 am

Re: three-dimensional panel data

Postby eviewsaoa » Fri Feb 08, 2019 2:16 am

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.

startz
Non-normality and collinearity are NOT problems!
Posts: 3775
Joined: Wed Sep 17, 2008 2:25 pm

Re: three-dimensional panel data

Postby startz » Fri Feb 08, 2019 12:20 pm

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.

eviewsaoa
Posts: 7
Joined: Tue Jul 17, 2018 7:59 am

Re: three-dimensional panel data

Postby eviewsaoa » Tue Feb 26, 2019 9:00 am

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.

startz
Non-normality and collinearity are NOT problems!
Posts: 3775
Joined: Wed Sep 17, 2008 2:25 pm

Re: three-dimensional panel data

Postby startz » Tue Feb 26, 2019 12:25 pm

I don't think there is an easier way in a nonlinear model, although I may have forgotten something.

eviewsaoa
Posts: 7
Joined: Tue Jul 17, 2018 7:59 am

Re: three-dimensional panel data

Postby eviewsaoa » Wed Feb 27, 2019 2:38 am

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.

startz
Non-normality and collinearity are NOT problems!
Posts: 3775
Joined: Wed Sep 17, 2008 2:25 pm

Re: three-dimensional panel data

Postby startz » Wed Feb 27, 2019 11:58 am

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.

eviewsaoa
Posts: 7
Joined: Tue Jul 17, 2018 7:59 am

Re: three-dimensional panel data

Postby eviewsaoa » Thu Feb 28, 2019 3:47 am

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.


Return to “Data Manipulation”

Who is online

Users browsing this forum: No registered users and 20 guests