panel data regression models in eviews: pooled … · 12/6/2017 · panel data regression model in...

24
PANEL DATA REGRESSION MODELS IN EVIEWS: Pooled OLS, Fixed or Random effect model? ADESETE, Ahmed Adefemi 12/6/2017

Upload: duongcong

Post on 14-Mar-2019

237 views

Category:

Documents


7 download

TRANSCRIPT

Page 1: PANEL DATA REGRESSION MODELS IN EVIEWS: Pooled … · 12/6/2017 · Panel Data Regression Model in Eviews Adesete Ahmed Adefemi 11 11 Then, List all the data to be used for the panel

PANEL DATA REGRESSION MODELS IN EVIEWS: Pooled OLS, Fixed or Random effect model? ADESETE, Ahmed Adefemi 12/6/2017

Page 2: PANEL DATA REGRESSION MODELS IN EVIEWS: Pooled … · 12/6/2017 · Panel Data Regression Model in Eviews Adesete Ahmed Adefemi 11 11 Then, List all the data to be used for the panel

Adesete Ahmed Adefemi Panel Data Regression Model in Eviews

2 Panel Data Regression Model in Eviews Adesete Ahmed Adefemi

2

PANEL DATA REGRESSION MODELS IN EVIEWS: Pooled OLS, Fixed or Random effect model?

Panel data refers to a type of data that contains observations of multiple phenomena collected over

different time period for the same group of individuals, units or entities. In short, in econometrics

panel data refers to a multidimensional data collected over a period of time.

Panel data analysis on the other hand refers to a statistical method widely used in different disciplines

such as social sciences, econometrics to analyze data that are collected for multiple periods and over

the same individuals or entities. A simple panel data regression can specified thus:

Yit = a + bXit + εit

Y......dependent variable

X......independent or explanatory variable

a, b....coefficients

i, t......indices for individuals and time

ε........error term

Panel data regression analysis can be done in mainly three ways:

(1) Independently Pooled OLS regression model.

(2) Fixed effects model

(3) Random effects model

Independently Pooled OLS regression model

This type of panel data model assumes homogeneity of all sections of data in a panel data study that is

it does not treat each section differently. Alternatively, it treats all section as just a single section of

data. In short, there are no unique characteristics of individuals within the measurement set and no

universal effects over time. Example if Panel data is collected for six countries across 1980-1990,

Pooled OLS does not distinguish between these six countries while also neglecting the cross section

and time series nature of the data.

Fixed effects model

This type of model allows for heterogeneity or individuality among different cross-sections allowing

each cross-section to have its own intercept. In short, the intercept may be different for the cross-

sections but it is time invariant that is the intercept remains the same over time. The error term in a

Page 3: PANEL DATA REGRESSION MODELS IN EVIEWS: Pooled … · 12/6/2017 · Panel Data Regression Model in Eviews Adesete Ahmed Adefemi 11 11 Then, List all the data to be used for the panel

Adesete Ahmed Adefemi Panel Data Regression Model in Eviews

3 Panel Data Regression Model in Eviews Adesete Ahmed Adefemi

3

fixed effects model is assumed to vary non-stochastically over each entity and time. There are unique

attributes of individuals which do not vary across time and is correlated with independent variables.

Summarily, we can conclude that in a fixed effects models, the parameters of the model are fixed

alternatively, the group means are fixed. The fixed effect model can be estimated with the aid of

dummy variables.

Random effects model

This model is also known as the variance components model. Random effect model also allows for

heterogeneity and is also time invariant but the individual specific effect is uncorrelated with the

independent variables. It can also refer to as a kind of hierarchical linear model which adopts the

assumption of data being drawn from a hierarchy of different populations whose differences relates to

that hierarchy.

The Question is, How are these models estimated and how is the correct choice of model made?

Panel data regression analysis in Eviews.

The main objective of this tutorial is to learn how to estimate Pooled OLS regression model, Fixed

effect model, Random effect model and also how to make the correct choice of model amongst the

three models in a panel study. Data on GDP, Inflation rate, Export and Import for Nigeria, Ghana,

Gambia and Togo over time period 1992-2000.

STEP 1

The first step is to Open navigate to the Eviews icon and click to open the eviews working

environment.

Page 4: PANEL DATA REGRESSION MODELS IN EVIEWS: Pooled … · 12/6/2017 · Panel Data Regression Model in Eviews Adesete Ahmed Adefemi 11 11 Then, List all the data to be used for the panel

Adesete Ahmed Adefemi Panel Data Regression Model in Eviews

4 Panel Data Regression Model in Eviews Adesete Ahmed Adefemi

4

STEP 2: Create a new workfile. Click on file in the eviews work environment ad navigate to New and

then to Workfile. File > New > Workfile

After clicking on workfile, you should have a workfile environment like this:

Under the Workfile structure type column, navigate to Balanced Panel. Under the date specification

box, select the frequency of data. In this case we would select annual because we are making use of an

annual panel data. After navigating to Balanced panel, there should be a display icon like this:

Page 5: PANEL DATA REGRESSION MODELS IN EVIEWS: Pooled … · 12/6/2017 · Panel Data Regression Model in Eviews Adesete Ahmed Adefemi 11 11 Then, List all the data to be used for the panel

Adesete Ahmed Adefemi Panel Data Regression Model in Eviews

5 Panel Data Regression Model in Eviews Adesete Ahmed Adefemi

5

The start date for the data employed for this article is 1992 and the end date is 2000 while the number

of cross sections is four(4). Panel data tutorial is the given workfile name. Click OK if these fields are

already filled.

The eviews created workfile environment should display as below:

Page 6: PANEL DATA REGRESSION MODELS IN EVIEWS: Pooled … · 12/6/2017 · Panel Data Regression Model in Eviews Adesete Ahmed Adefemi 11 11 Then, List all the data to be used for the panel

Adesete Ahmed Adefemi Panel Data Regression Model in Eviews

6 Panel Data Regression Model in Eviews Adesete Ahmed Adefemi

6

STEP 3:

Upload the panel data. Open the data in Microsoft excel package.

Highlight the data and copy

After copying the data, open the panel data workfile environment again, right click on the workfile

environment and navigate to paste :

Page 7: PANEL DATA REGRESSION MODELS IN EVIEWS: Pooled … · 12/6/2017 · Panel Data Regression Model in Eviews Adesete Ahmed Adefemi 11 11 Then, List all the data to be used for the panel

Adesete Ahmed Adefemi Panel Data Regression Model in Eviews

7 Panel Data Regression Model in Eviews Adesete Ahmed Adefemi

7

After finally clicking on paste, you should have this:

Click on Next

Page 8: PANEL DATA REGRESSION MODELS IN EVIEWS: Pooled … · 12/6/2017 · Panel Data Regression Model in Eviews Adesete Ahmed Adefemi 11 11 Then, List all the data to be used for the panel

Adesete Ahmed Adefemi Panel Data Regression Model in Eviews

8 Panel Data Regression Model in Eviews Adesete Ahmed Adefemi

8

Change the Basic Structure box from Dated panel to Dated-regular frequency then set the start

date as highlighted in blue below.

Finally Click Finish to complete uploading data.

Page 9: PANEL DATA REGRESSION MODELS IN EVIEWS: Pooled … · 12/6/2017 · Panel Data Regression Model in Eviews Adesete Ahmed Adefemi 11 11 Then, List all the data to be used for the panel

Adesete Ahmed Adefemi Panel Data Regression Model in Eviews

9 Panel Data Regression Model in Eviews Adesete Ahmed Adefemi

9

Another method of uploading data is the IMPORT Method. From the created workfile, click file on

the top left hand corner of the workfile environment and navigate to Import then finally click import

from file. Navigate to the file where the data is saved

After selecting the data, you should have a display screen like this:

The highlighted blue part signifies the sheet numbers in which the data is located. In this case,

sheet 1 is selected. Other steps should follow as indicated in the copy and paste method.

Page 10: PANEL DATA REGRESSION MODELS IN EVIEWS: Pooled … · 12/6/2017 · Panel Data Regression Model in Eviews Adesete Ahmed Adefemi 11 11 Then, List all the data to be used for the panel

Adesete Ahmed Adefemi Panel Data Regression Model in Eviews

10 Panel Data Regression Model in Eviews Adesete Ahmed Adefemi

10

STEP 4:

Run the Panel Data regression. This regression analysis would be done using three different panel

data regression models which are:

(1) Pooled OLS Regression model

(2) Fixed effects panel regression model

(3) Random effects panel regression model

1) Pooled OLS regression model

Step A: Go to the empty white space(it is highlighted with blue below) at the top of the created

workfile and type POOL. Then click Enter on your computer/laptop

Step B: After Clicking Enter, you should have a screen like this:

Page 11: PANEL DATA REGRESSION MODELS IN EVIEWS: Pooled … · 12/6/2017 · Panel Data Regression Model in Eviews Adesete Ahmed Adefemi 11 11 Then, List all the data to be used for the panel

Adesete Ahmed Adefemi Panel Data Regression Model in Eviews

11 Panel Data Regression Model in Eviews Adesete Ahmed Adefemi

11

Then, List all the data to be used for the panel data study in the empty white space vertically.

Click Define after listing the data

STEP C: Then Navigate to Estimate and Click. A screen display like below would appear.

Page 12: PANEL DATA REGRESSION MODELS IN EVIEWS: Pooled … · 12/6/2017 · Panel Data Regression Model in Eviews Adesete Ahmed Adefemi 11 11 Then, List all the data to be used for the panel

Adesete Ahmed Adefemi Panel Data Regression Model in Eviews

12 Panel Data Regression Model in Eviews Adesete Ahmed Adefemi

12

Specify the dependent variable and the independent variables as the common coefficients except

there is a particular case where the effect of each cross section on another cross section would be

studied, then cross-section specific coefficients would be specified.

Click OK to have the estimation result.

This is the final result of the Pooled OLS estimation technique.

Page 13: PANEL DATA REGRESSION MODELS IN EVIEWS: Pooled … · 12/6/2017 · Panel Data Regression Model in Eviews Adesete Ahmed Adefemi 11 11 Then, List all the data to be used for the panel

Adesete Ahmed Adefemi Panel Data Regression Model in Eviews

13 Panel Data Regression Model in Eviews Adesete Ahmed Adefemi

13

2) Fixed effects panel regression model

STEP A: Navigate to Quick. From Quick, navigate to Estimate Equation and click.

After clicking Estimate Equation, there should be a display like this.

Page 14: PANEL DATA REGRESSION MODELS IN EVIEWS: Pooled … · 12/6/2017 · Panel Data Regression Model in Eviews Adesete Ahmed Adefemi 11 11 Then, List all the data to be used for the panel

Adesete Ahmed Adefemi Panel Data Regression Model in Eviews

14 Panel Data Regression Model in Eviews Adesete Ahmed Adefemi

14

STEP B: Specify the equation log(gdp) c log(import) log(export) log(pop)

STEP C: Click Panel Options and change Cross Section Box under Effects Specification to Fixed.

Page 15: PANEL DATA REGRESSION MODELS IN EVIEWS: Pooled … · 12/6/2017 · Panel Data Regression Model in Eviews Adesete Ahmed Adefemi 11 11 Then, List all the data to be used for the panel

Adesete Ahmed Adefemi Panel Data Regression Model in Eviews

15 Panel Data Regression Model in Eviews Adesete Ahmed Adefemi

15

STEP D: Click OK

This is the Fixed effect panel regression estimation result

3) Random effects panel regression model

STEP A: Navigate to Quick. From Quick, navigate to Estimate Equation and click.

Page 16: PANEL DATA REGRESSION MODELS IN EVIEWS: Pooled … · 12/6/2017 · Panel Data Regression Model in Eviews Adesete Ahmed Adefemi 11 11 Then, List all the data to be used for the panel

Adesete Ahmed Adefemi Panel Data Regression Model in Eviews

16 Panel Data Regression Model in Eviews Adesete Ahmed Adefemi

16

After clicking Estimate Equation, there should be a display like this.

STEP B: Specify the equation log(gdp) c log(import) log(export) log(pop)

STEP C: Click Panel Options and change Cross Section Box under Effects Specification to

Random.

Page 17: PANEL DATA REGRESSION MODELS IN EVIEWS: Pooled … · 12/6/2017 · Panel Data Regression Model in Eviews Adesete Ahmed Adefemi 11 11 Then, List all the data to be used for the panel

Adesete Ahmed Adefemi Panel Data Regression Model in Eviews

17 Panel Data Regression Model in Eviews Adesete Ahmed Adefemi

17

STEP D: Click OK

This is the Random effect panel regression estimation result

How is the right Choice of model made between these three models? The answer to this, is the

Correlated Random effects-Hausman test and the Wald test.

Correlated Random effects-Hausman test:

This is used as a test to determine the right model between the fixed and random effects model.

Hypothesis: Null hypothesis(H0).................Random effects model is appropriate

Alternative hypothesis(HA).....Fixed effects model is appropriate

Decision Criterion: Reject H0 if probability value is less than 5%, Accept H0 if probability value is

greater than 5%.

Page 18: PANEL DATA REGRESSION MODELS IN EVIEWS: Pooled … · 12/6/2017 · Panel Data Regression Model in Eviews Adesete Ahmed Adefemi 11 11 Then, List all the data to be used for the panel

Adesete Ahmed Adefemi Panel Data Regression Model in Eviews

18 Panel Data Regression Model in Eviews Adesete Ahmed Adefemi

18

Steps for computing the Correlated Random effects-Hausman test

STEP 1

Open the Random effects model estimation result in the eviews workfile

STEP 2

Click on View and navigate to Fixed/Random Effects Testing and finally select Correlated Random

effects-Hausman Test as demonstrated in the picture below.

View > Fixed/Random Effects Testing > Correlated Random effects-Hausman Test.

Page 19: PANEL DATA REGRESSION MODELS IN EVIEWS: Pooled … · 12/6/2017 · Panel Data Regression Model in Eviews Adesete Ahmed Adefemi 11 11 Then, List all the data to be used for the panel

Adesete Ahmed Adefemi Panel Data Regression Model in Eviews

19 Panel Data Regression Model in Eviews Adesete Ahmed Adefemi

19

STEP 3

After Clicking Correlated Random effects-Hausman Test, this should be the estimation result

Check the probability value and make decision based on the decision criterion. The probability value

here is 1.0000 which is greater than 5% thereby we accept null hypothesis and conclude that the

random effects model is appropriate.

Assume the Fixed effects model is the right model, To determine the right model between the

Fixed effect model and the Pooled OLS regression model, the Wald test is adopted.

Hypothesis: Null hypothesis(H0)...............Pooled OLS regression model is appropriate(All dummy

variables equal zero)

Alternative Hypothesis(HA)...Fixed effect model is appropriate(All dummy variables

does not equal zero)

Decision criterion: Reject H0 if probability value of the Wald test is less than 5% , Accept H0 if the

probability value of the Wald test is greater than 5%.

Page 20: PANEL DATA REGRESSION MODELS IN EVIEWS: Pooled … · 12/6/2017 · Panel Data Regression Model in Eviews Adesete Ahmed Adefemi 11 11 Then, List all the data to be used for the panel

Adesete Ahmed Adefemi Panel Data Regression Model in Eviews

20 Panel Data Regression Model in Eviews Adesete Ahmed Adefemi

20

STEP 1

Estimate a Fixed effect model using dummy variables with one dummy variables to each

coefficient. Here we have three variables , so we are going to have three dummy variables too.

Specify the equation as below with the Panel Options left unchanged.

Page 21: PANEL DATA REGRESSION MODELS IN EVIEWS: Pooled … · 12/6/2017 · Panel Data Regression Model in Eviews Adesete Ahmed Adefemi 11 11 Then, List all the data to be used for the panel

Adesete Ahmed Adefemi Panel Data Regression Model in Eviews

21 Panel Data Regression Model in Eviews Adesete Ahmed Adefemi

21

STEP 2

Click OK and have the Fixed effects model estimation result

STEP 3: Click View and navigate to Coefficient diagnostics and then to Wald test

STEP 4: Click on the Wald test

Page 22: PANEL DATA REGRESSION MODELS IN EVIEWS: Pooled … · 12/6/2017 · Panel Data Regression Model in Eviews Adesete Ahmed Adefemi 11 11 Then, List all the data to be used for the panel

Adesete Ahmed Adefemi Panel Data Regression Model in Eviews

22 Panel Data Regression Model in Eviews Adesete Ahmed Adefemi

22

List the Coefficients of the dummy variables as listed below and equate all to Zero

Click OK and get the estimation result

Decision: Reject Null hypothesis and conclude that the fixed effect model is the appropriate model

because the probability value(0.0040) is less than 5% .

NOTE: The first step is to test between the Fixed effect model and the Random effect model. If

the Fixed effect model is the appropriate model after the test, then you should test further for

the choice of model between the Fixed effect model and Pooled OLS regression model .If the

Random effect model is the appropriate model then a further test would not be required. But if

it is the other way round, the first step would be to determine the choice of model between the

fixed effect model and Pooled OLS regression model, if the Fixed effect model is the appropriate

model then you would use the Hausman test to check further the appropriate model between the

Page 23: PANEL DATA REGRESSION MODELS IN EVIEWS: Pooled … · 12/6/2017 · Panel Data Regression Model in Eviews Adesete Ahmed Adefemi 11 11 Then, List all the data to be used for the panel

Adesete Ahmed Adefemi Panel Data Regression Model in Eviews

23 Panel Data Regression Model in Eviews Adesete Ahmed Adefemi

23

Fixed effect and the Random effect model. If Pooled OLS regression model is preferred then a

further test would not be necessary.

Any further research questions or questions regarding this article should be forwarded to

[email protected].

Use of information on this publication/website is at your own risk. No part of this publication

may be reproduced, downloaded or transmitted in any form or by any means published

somewhere without the author permission. All publications are copyrighted by the author and

publications are used for research and understanding purposes.

DATA USED

YEARS COUNTRY GDP POP EXPORT IMPORT D2 D3 D4 1992 BENIN 1.7E+09 5331803 3.94E+08 5.68E+08 1 0 1 1993 BENIN 2.27E+09 5521763 5.11E+08 7.49E+08 1 0 0 1994 BENIN 1.6E+09 5714220 4.53E+08 5.76E+08 1 0 1 1995 BENIN 2.17E+09 5905558 5.94E+08 7.9E+08 1 0 0 1996 BENIN 2.36E+09 6094259 6.26E+08 7.09E+08 1 1 1 1997 BENIN 2.27E+09 6281639 6.16E+08 7.15E+08 0 1 0 1998 BENIN 2.46E+09 6470265 6.65E+08 7.98E+08 0 1 1 1999 BENIN 2.69E+09 6664098 6.37E+08 1.1E+09 0 1 0 2000 BENIN 2.57E+09 6865951 5.43E+08 8.95E+08 0 1 1 1992 GAMBIA 5.04E+08 979718 2.19E+08 2.63E+08 1 0 0 1993 GAMBIA 5.19E+08 1008358 2.13E+08 2.75E+08 1 0 1 1994 GAMBIA 5.2E+08 1036829 1.59E+08 2.14E+08 1 0 0 1995 GAMBIA 5.24E+08 1066223 1.87E+08 2.79E+08 1 0 1 1996 GAMBIA 5.36E+08 1096708 1.85E+08 2.47E+08 1 1 0 1997 GAMBIA 5.62E+08 1128169 1.84E+08 2.04E+08 0 1 1 1998 GAMBIA 5.82E+08 1160944 2.13E+08 2.4E+08 0 1 0 1999 GAMBIA 6.19E+08 1195420 1.99E+08 2.28E+08 0 1 1 2000 GAMBIA 6.53E+08 1231844 2.02E+08 2.39E+08 0 1 0 1992 GHANA 6.41E+09 15463854 1.1E+09 1.85E+09 1 0 1 1993 GHANA 5.97E+09 15896432 1.21E+09 2.17E+09 1 0 0 1994 GHANA 5.44E+09 16330174 1.38E+09 2E+09 1 0 1 1995 GHANA 6.47E+09 16760467 1.58E+09 2.13E+09 1 0 0 1996 GHANA 6.93E+09 17185608 2.23E+09 2.78E+09 1 1 1 1997 GHANA 6.89E+09 17608812 2.23E+09 3.65E+09 0 1 0 1998 GHANA 7.48E+09 18036494 2.53E+09 3.5E+09 0 1 1 1999 GHANA 7.72E+09 18477612 2.48E+09 3.83E+09 0 1 0 2000 GHANA 4.98E+09 18938762 2.43E+09 3.35E+09 0 1 1 1992 TOGO 1.69E+09 3973327 4.56E+08 6.12E+08 1 0 0 1993 TOGO 1.23E+09 4064926 3.01E+08 3.96E+08 1 0 1

Page 24: PANEL DATA REGRESSION MODELS IN EVIEWS: Pooled … · 12/6/2017 · Panel Data Regression Model in Eviews Adesete Ahmed Adefemi 11 11 Then, List all the data to be used for the panel

Adesete Ahmed Adefemi Panel Data Regression Model in Eviews

24 Panel Data Regression Model in Eviews Adesete Ahmed Adefemi

24

1994 TOGO 9.83E+08 4163642 3E+08 3.37E+08 1 0 0 1995 TOGO 1.31E+09 4274024 4.25E+08 4.9E+08 1 0 1 1996 TOGO 1.47E+09 4398238 4.88E+08 6.47E+08 1 1 0 1997 TOGO 1.5E+09 4534551 4.34E+08 6.72E+08 0 1 1 1998 TOGO 1.59E+09 4679023 4.71E+08 6.87E+08 0 1 0 1999 TOGO 1.58E+09 4825704 4.55E+08 6.15E+08 0 1 1 2000 TOGO 1.29E+09 4970367 4.45E+08 6.16E+08 0 1 0