## two way panel

For questions regarding the import, export and manipulation of data in EViews, including graphing and basic statistics.
startz
Non-normality and collinearity are NOT problems!
Posts: 3337
Joined: Wed Sep 17, 2008 2:25 pm

### two way panel

(This may not be the most clever question ever.)

I would like to create a two-way panel so I can use two sets of fixed effects. Think of one id being a student grade and the other being a department. The two together do not give a unique identifier, since a student may take multiple courses in one department.

When I restructure, I get a three dimensional panel to get a unique id. But then I don't get the option to use fixed effects.

What am I missing?

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

### Re: two way panel

We don't offer fixed effects for 3D panels. Only two dimensions (even if one of them isn't time).

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

### Re: two way panel

EViews Gareth wrote:We don't offer fixed effects for 3D panels. Only two dimensions (even if one of them isn't time).

That's kind of what I thought. The issue is that sometimes one wants to do fixed effects and there's no way to do that without creating a panel.

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

### Re: two way panel

Dummies?

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

### Re: two way panel

One dimension has about 100 categories. That'll work. The other has 20,000. I need something to sweep out the dummies.

EViews Glenn
EViews Developer
Posts: 2590
Joined: Wed Oct 15, 2008 9:17 am

### Re: two way panel

If you have three variables, say Y, X1, and X2, you can easily demean using

Code: Select all

`frml ydm = y - @meansby(y, id)frml x1dm = x - @meansby(x1, id)frml x2dm = x - @meansby(x2, id)`

where ID is the categorization variable corresponding to the 10,000 dummies. The result will be the series with means-by-category removed.

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

### Re: two way panel

EViews Glenn wrote:If you have three variables, say Y, X1, and X2, you can easily demean using

Code: Select all

`frml ydm = y - @meansby(y, id)frml x1dm = x - @meansby(x1, id)frml x2dm = x - @meansby(x2, id)`

where ID is the categorization variable corresponding to the 10,000 dummies. The result will be the series with means-by-category removed.

Yes, but one of the other variables is an @expand with about 50 categories. So 50 dummies would have to be generated and demeaned. Is there an easy way to do that?

EViews Glenn
EViews Developer
Posts: 2590
Joined: Wed Oct 15, 2008 9:17 am

### Re: two way panel

The @expand should work for the remaining dimension, no?

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

### Re: two way panel

The @expand dummies would need to be treated by the @meansby demeaning, no?

EViews Glenn
EViews Developer
Posts: 2590
Joined: Wed Oct 15, 2008 9:17 am

### Re: two way panel

True. I forget that you are unbalanced.