Hi, is there a way to measure "between effects" in unbalanced panels using EViews 7?
Background: Fixed-effects models allow the analysis of "within effects", random-effects and pooled-OLS regressions measure both within and between effects.
Is there any add-in or any other simple way to isolate between effects (in unbalanced panels!)?
Thanks in advance for any suggestions,
Ralf
Measuring between effects for panels
Moderators: EViews Gareth, EViews Moderator
-
EViews Glenn
- EViews Developer
- Posts: 2682
- Joined: Wed Oct 15, 2008 9:17 am
Re: Measuring between effects for panels
I really should make this a FAQ on this one when I get a chance...
The between regression simply regresses means by cross-section of the dependent variable on means by cross-section of the independent variables. There are a number of relatively easy ways of doing this. I'll discuss two:
1. Using a new Workfile Page (harder)
The most sophisticated way to do this is to create a new workfile page containing only the cross-section identifiers, then to link over your data using means to contract the data. Suppose you have a panel with cross-section ID variable FN, then you should first enter the command
to create a new page containing only the identifier values. You can perform the same operation by clicking on the New Page tab on the bottom of your workfile, selecting Specify by Identifier Series... and entering "FN" under Cross ID series (and clearing out the Date ID series edit field).
Next, copy all of your independent and dependent variables from the original page into the new page. The easiest way to do this is to select all of the series, right-click and choose Copy, then go to the new page and right-click and select Paste Special. The default settings for the paste should be to match merge using the IDs and to use means to perform the contraction. You could also do this last step with the copy command.
Then just run the regression of interest in the new page.
While a bit of work to set up, this approach has the advantage of then allowing you do whatever kinds of analysis you want with the means data.
2. Using the existing Workfile Page
We will use the @meansby(VAR, @crossid) to compute the means of the data by cross-section. Suppose you have the series Y and you wish to regression on X1 and X2. Then you should create variables containing the cross-section means (I'm assuming here that the sample is set the entire sample -- the code below can be modified accordingly):
and then run the regression
to get the between regression. Note that we use the @cellid condition to ensure that we get only one observation per cross-section.
On a parenthetic note. The reason that we don't offer the between regression as a built-in EViews feature is that it doesn't work like our other equation objects in the sense that uses a sample and data that don't match the data or sample found in the workfile. So working with an equation object estimated in this way is difficult.
One other note: I'm not doing any adjustments in the equations for the unequal number of observations in an unbalanced panel. It should be straightforward to do adjustments depending on how you want to handle that...
That said, this is a good candidate for an add-in and I'll look into this in the near future.
The between regression simply regresses means by cross-section of the dependent variable on means by cross-section of the independent variables. There are a number of relatively easy ways of doing this. I'll discuss two:
1. Using a new Workfile Page (harder)
The most sophisticated way to do this is to create a new workfile page containing only the cross-section identifiers, then to link over your data using means to contract the data. Suppose you have a panel with cross-section ID variable FN, then you should first enter the command
Code: Select all
pagecreate(byid, page=means) fnNext, copy all of your independent and dependent variables from the original page into the new page. The easiest way to do this is to select all of the series, right-click and choose Copy, then go to the new page and right-click and select Paste Special. The default settings for the paste should be to match merge using the IDs and to use means to perform the contraction. You could also do this last step with the copy command.
Then just run the regression of interest in the new page.
While a bit of work to set up, this approach has the advantage of then allowing you do whatever kinds of analysis you want with the means data.
2. Using the existing Workfile Page
We will use the @meansby(VAR, @crossid) to compute the means of the data by cross-section. Suppose you have the series Y and you wish to regression on X1 and X2. Then you should create variables containing the cross-section means (I'm assuming here that the sample is set the entire sample -- the code below can be modified accordingly):
Code: Select all
smpl @all
series ym = @meansby(y, @crossid)
series x1m = @meansby(x1, @crossid)
series x2m = @meansby(x2, @crossid)Code: Select all
smpl if @cellid=@minsby(@cellid, @crossid)
equation eqbtw.ls ym c x1m x2mOn a parenthetic note. The reason that we don't offer the between regression as a built-in EViews feature is that it doesn't work like our other equation objects in the sense that uses a sample and data that don't match the data or sample found in the workfile. So working with an equation object estimated in this way is difficult.
One other note: I'm not doing any adjustments in the equations for the unequal number of observations in an unbalanced panel. It should be straightforward to do adjustments depending on how you want to handle that...
That said, this is a good candidate for an add-in and I'll look into this in the near future.
Re: Measuring between effects for panels
Thanks Glenn!
Re: Measuring between effects for panels
Hi Glenn,
now I'm working with an unbalanced panel and I would like to perform a cross-sectional regression again. I calculated the means in the existing workfile page and tried to run the regression with averages from all cross-sections. Each average should only be included only once, unfortunately I don't have any year with data for all cross-sections. Can I run a regression with averages for my cross-sections only?
Thanks,
Ralf
now I'm working with an unbalanced panel and I would like to perform a cross-sectional regression again. I calculated the means in the existing workfile page and tried to run the regression with averages from all cross-sections. Each average should only be included only once, unfortunately I don't have any year with data for all cross-sections. Can I run a regression with averages for my cross-sections only?
Thanks,
Ralf
Who is online
Users browsing this forum: No registered users and 2 guests
