panel data models econ 6002 econometrics i memorial university of newfoundland adapted from vera...

67
ECON 6002 Econometrics I Memorial University of Newfoundland Adapted from Vera Tabakova’s notes

Upload: gerard-marsh

Post on 13-Jan-2016

229 views

Category:

Documents


4 download

TRANSCRIPT

Page 1: Panel Data Models ECON 6002 Econometrics I Memorial University of Newfoundland Adapted from Vera Tabakova’s notes

ECON 6002Econometrics IMemorial University of Newfoundland

Adapted from Vera Tabakova’s notes

Page 2: Panel Data Models ECON 6002 Econometrics I Memorial University of Newfoundland Adapted from Vera Tabakova’s notes

15.1 Grunfeld’s Investment Data

15.2 Sets of Regression Equations

15.3 Seemingly Unrelated Regressions

15.4 The Fixed Effects Model

15.4 The Random Effects Model

Extensions RCM, dealing with endogeneity when we have

static variables

Page 3: Panel Data Models ECON 6002 Econometrics I Memorial University of Newfoundland Adapted from Vera Tabakova’s notes

The different types of panel data sets can be described as:

“long and narrow,” with “long” time dimension and “narrow”, few

cross sectional units;

“short and wide,” many units observed over a short period of time;

“long and wide,” indicating that both N and T are relatively large.

Page 4: Panel Data Models ECON 6002 Econometrics I Memorial University of Newfoundland Adapted from Vera Tabakova’s notes

The data consist of T = 20 years of data (1935-1954) for N = 10 large firms.

Let yit = INVit and x2it = Vit and x3it = Kit

,it it itINV f V K

1 2 2 3 3it it it it it it ity x x e

Notice the subindices!

Value of stock, proxy for expected profitsCapital stock, proxy for desired permanentCapital stock

Page 5: Panel Data Models ECON 6002 Econometrics I Memorial University of Newfoundland Adapted from Vera Tabakova’s notes

, 1 2 , 3 , ,

, 1 2 , 3 , ,

1, ,20

1, ,20

GE t GE t GE t GE t

WE t WE t WE t WE t

INV V K e t

INV V K e t

1 2 2 3 3 1, 2; 1, ,20it it it ity x x e i t

For simplicity we focus on only two firmskeep if (i==3 | i==8) in STATA

Page 6: Panel Data Models ECON 6002 Econometrics I Memorial University of Newfoundland Adapted from Vera Tabakova’s notes

, 1, 2, , 3, , ,

, 1, 2, , 3, , ,

1, ,20

1, ,20

GE t GE GE GE t GE GE t GE t

WE t WE WE WE t WE WE t WE t

INV V K e t

INV V K e t

1 2 2 3 3 1, 2; 1, ,20it i i it i it ity x x e i t

Page 7: Panel Data Models ECON 6002 Econometrics I Memorial University of Newfoundland Adapted from Vera Tabakova’s notes

Assumption (15.5) says that the errors in both investment functions (i) have zero mean, (ii) are homoskedastic with constant variance, and (iii) are not correlated over time; autocorrelation does not exist. The two equations do have different error variances

2, , , ,

2, , , ,

0 var cov , 0

0 var cov , 0

GE t GE t GE GE t GE s

WE t WE t WE WE t WE s

E e e e e

E e e e e

2 2 and .GE WE

Page 8: Panel Data Models ECON 6002 Econometrics I Memorial University of Newfoundland Adapted from Vera Tabakova’s notes

reg inv v k if i==3scalar sse_ge = e(rss)

reg inv v k if i==8scalar sse_we = e(rss)

Page 9: Panel Data Models ECON 6002 Econometrics I Memorial University of Newfoundland Adapted from Vera Tabakova’s notes

Let Di be a dummy variable equal to 1 for the Westinghouse

observations and 0 for the General Electric observations.

1, 1 2, 2 3, 3it GE i GE it i it GE it i it itINV D V D V K D K e

* Create dummy variablegen d = (i == 8)gen dv = d*vgen dk = d*k

* Estimate dummy variable modelreg inv d v dv k dktest d dv dk

Page 10: Panel Data Models ECON 6002 Econometrics I Memorial University of Newfoundland Adapted from Vera Tabakova’s notes
Page 11: Panel Data Models ECON 6002 Econometrics I Memorial University of Newfoundland Adapted from Vera Tabakova’s notes

This assumption says that the error terms in the two equations, at the same point in time, are correlated. This kind of correlation is called a contemporaneous correlation.

, , ,cov ,GE t WE t GE WEe e

Page 12: Panel Data Models ECON 6002 Econometrics I Memorial University of Newfoundland Adapted from Vera Tabakova’s notes

Econometric software includes commands for SUR (or SURE) that

carry out the following steps:

(i) Estimate the equations separately using least squares;

(ii)Use the least squares residuals from step (i) to estimate

;

(iii)Use the estimates from step (ii) to estimate the two equations jointly

within a generalized least squares framework.

2 2,, and GE WE GE WE

Page 13: Panel Data Models ECON 6002 Econometrics I Memorial University of Newfoundland Adapted from Vera Tabakova’s notes
Page 14: Panel Data Models ECON 6002 Econometrics I Memorial University of Newfoundland Adapted from Vera Tabakova’s notes

* Open and summarize datause grunfeld2, clearsummarize

* SUR sureg ( inv_ge v_ge k_ge) ( inv_we v_we k_we), corrtest ([inv_ge]_cons = [inv_we]_cons) ([inv_ge]_b[v_ge] = [inv_we]_b[v_we]) ([inv_ge]_b[k_ge] = [inv_we]_b[k_we])

Page 15: Panel Data Models ECON 6002 Econometrics I Memorial University of Newfoundland Adapted from Vera Tabakova’s notes

There are two situations where separate least squares estimation is

just as good as the SUR technique :

(i) when the equation errors are not contemporaneously correlated;

(ii)when the same explanatory variables appear in each equation.

If the explanatory variables in each equation are different, then a test

to see if the correlation between the errors is significantly different

from zero is of interest.

Page 16: Panel Data Models ECON 6002 Econometrics I Memorial University of Newfoundland Adapted from Vera Tabakova’s notes

In this case we have 3 parameters in each equation so:

22,2

, 2 2

ˆ 207.58710.53139

ˆ ˆ 777.4463 104.3079GE WE

GE WEGE WE

r

20 20

, , , , ,1 1

1 1ˆ ˆ ˆ ˆ ˆ

3GE WE GE t WE t GE t WE tt tGE WE

e e e eTT K T K

3.GE WEK K

Page 17: Panel Data Models ECON 6002 Econometrics I Memorial University of Newfoundland Adapted from Vera Tabakova’s notes

Testing for correlated errors for two equations:

LM = 10.628 > 3.84

Hence we reject the null hypothesis of no correlation between the

errors and conclude that there are potential efficiency gains from

estimating the two investment equations jointly using SUR.

0 ,: 0GE WEH

2 2, (1) 0 under .GE WELM Tr H

Page 18: Panel Data Models ECON 6002 Econometrics I Memorial University of Newfoundland Adapted from Vera Tabakova’s notes

Testing for correlated errors for three equations:

0 12 13 23: 0H

2 2 2 212 13 23 (3)LM T r r r

Page 19: Panel Data Models ECON 6002 Econometrics I Memorial University of Newfoundland Adapted from Vera Tabakova’s notes

Testing for correlated errors for M equations:

Under the null hypothesis that there are no contemporaneous

correlations, this LM statistic has a χ2-distribution with M(M–1)/2

degrees of freedom, in large samples.

12

2 1

M i

iji j

LM T r

Page 20: Panel Data Models ECON 6002 Econometrics I Memorial University of Newfoundland Adapted from Vera Tabakova’s notes

Most econometric software will perform an F-test and/or a Wald χ2–test; in the context of SUR equations both tests are large sample approximate tests.

The F-statistic has J numerator degrees of freedom and (MTK) denominator degrees of freedom, where J is the number of hypotheses, M is the number of equations, and K is the total number of coefficients in the whole system, and T is the number of time series observations per equation. The χ2-statistic has J degrees of freedom.

0 1, 1, 2, 2, 3, 3,: , ,GE WE GE WE GE WEH

Page 21: Panel Data Models ECON 6002 Econometrics I Memorial University of Newfoundland Adapted from Vera Tabakova’s notes

We cannot consistently estimate the 3×N×T parameters in (15.9) with only NT total observations. But we can impose some more structure…

1 2 2 3 3it it it it it it ity x x e

1 1 2 2 3 3, ,it i it it

We consider only one-way effects and assume common slopeparameters across cross-sectional units

Page 22: Panel Data Models ECON 6002 Econometrics I Memorial University of Newfoundland Adapted from Vera Tabakova’s notes

All behavioral differences between individual firms and over time are

captured by the intercept. Individual intercepts are included to

“control” for these firm specific differences.

1 2 2 3 3it i it it ity x x e

Page 23: Panel Data Models ECON 6002 Econometrics I Memorial University of Newfoundland Adapted from Vera Tabakova’s notes

This specification is sometimes called the least squares dummy

variable model, or the fixed effects model.

1 2 3

1 1 1 2 1 3, , , etc.

0 otherwise 0 otherwise 0 otherwisei i i

i i iD D D

11 1 12 2 1,10 10 2 2 3 3it i i i it it itINV D D D V K e

Page 24: Panel Data Models ECON 6002 Econometrics I Memorial University of Newfoundland Adapted from Vera Tabakova’s notes
Page 25: Panel Data Models ECON 6002 Econometrics I Memorial University of Newfoundland Adapted from Vera Tabakova’s notes

These N–1= 9 joint null hypotheses are tested using the usual F-test

statistic. In the restricted model all the intercept parameters are equal.

If we call their common value β1, then the restricted model is:

0 11 12 1

1 1

:

: the are not all equal

N

i

H

H

1 2 3it it it itINV V K e

Page 26: Panel Data Models ECON 6002 Econometrics I Memorial University of Newfoundland Adapted from Vera Tabakova’s notes
Page 27: Panel Data Models ECON 6002 Econometrics I Memorial University of Newfoundland Adapted from Vera Tabakova’s notes

We reject the null hypothesis that the intercept parameters for all

firms are equal. We conclude that there are differences in firm

intercepts, and that the data should not be pooled into a single model

with a common intercept parameter.

1749128 522855 948.99

522855 200 12

R U

U

SSE SSE JF

SSE NT K

Page 28: Panel Data Models ECON 6002 Econometrics I Memorial University of Newfoundland Adapted from Vera Tabakova’s notes

1 2 2 3 3 1, ,it i it it ity x x e t T

1 2 2 3 31

1 T

it i it it itt

y x x eT

1 2 2 3 31 1 1 1

1 2 2 3 3

1 1 1 1T T T T

i it i it it itt t t t

i i i i

y y x x eT T T T

x x e

Page 29: Panel Data Models ECON 6002 Econometrics I Memorial University of Newfoundland Adapted from Vera Tabakova’s notes

1 2 2 3 3

1 2 2 3 3

2 2 2 3 3 3

( )

( ) ( ) ( )

it i it it it

i i i i i

it i it i it i it i

y x x e

y x x e

y y x x x x e e

2 3it it it ity x x e

Page 30: Panel Data Models ECON 6002 Econometrics I Memorial University of Newfoundland Adapted from Vera Tabakova’s notes
Page 31: Panel Data Models ECON 6002 Econometrics I Memorial University of Newfoundland Adapted from Vera Tabakova’s notes

.1098 .3106

(se*) (.0116) (.0169)

itit itINV V K

2*ˆ 2e SSE NT

2 2 198 188 1.02625NT NT N

Page 32: Panel Data Models ECON 6002 Econometrics I Memorial University of Newfoundland Adapted from Vera Tabakova’s notes
Page 33: Panel Data Models ECON 6002 Econometrics I Memorial University of Newfoundland Adapted from Vera Tabakova’s notes

1 2 2 3 3i i i iy b b x b x

1 2 2 3 3 1, ,i i i ib y b x b x i N

Page 34: Panel Data Models ECON 6002 Econometrics I Memorial University of Newfoundland Adapted from Vera Tabakova’s notes

ONE PROBLEM: Even with the trick of using the within estimator, we still implicitly (even if no longer explicitly) include N-1 dummy variables in our model (not N, since we remove the intercept), so we use up N-1 degrees of freedom.

It might not be then the most efficient way to estimate the common slope

ANOTHER ONE. By using deviations from the means, the procedure wipes out all the static variables, whose effects might be of interest

In order to overcome this problem, we can consider the random effects/or error components model

Page 35: Panel Data Models ECON 6002 Econometrics I Memorial University of Newfoundland Adapted from Vera Tabakova’s notes

1 1i iu

20, cov , 0, vari i j i uE u u u u

1 2 2 3 3

1 2 2 3 3

it i it it it

i it it it

y x x e

u x x e

Randomness of the intercept

Usual error

Page 36: Panel Data Models ECON 6002 Econometrics I Memorial University of Newfoundland Adapted from Vera Tabakova’s notes

Because the random effects regression error has two components, one

for the individual and one for the regression, the random effects

model is often called an error components model.

1 2 2 3 3

1 2 2 3 3

it it it it i

it it it

y x x e u

x x v

it i itv u e

a composite error

Page 37: Panel Data Models ECON 6002 Econometrics I Memorial University of Newfoundland Adapted from Vera Tabakova’s notes

0 0 0it i it i itE v E u e E u E e

2

2 2

var var

var var 2cov ,

v it i it

i it i it

u e

v u e

u e u e

Page 38: Panel Data Models ECON 6002 Econometrics I Memorial University of Newfoundland Adapted from Vera Tabakova’s notes

There are several correlations that can be considered.

The correlation between two individuals, i and j, at the same

point in time, t. The covariance for this case is given by

cov , ( )

0 0 0 0 0

it jt it jt i it j jt

i j i jt it j it jt

v v E v v E u e u e

E u u E u e E e u E e e

Page 39: Panel Data Models ECON 6002 Econometrics I Memorial University of Newfoundland Adapted from Vera Tabakova’s notes

The correlation between errors on the same individual (i) at

different points in time, t and s. The covariance for this case is

given by

2

2 2

cov , ( )

0 0 0

it is it is i it i is

i i is it i it is

u u

v v E v v E u e u e

E u E u e E e u E e e

Page 40: Panel Data Models ECON 6002 Econometrics I Memorial University of Newfoundland Adapted from Vera Tabakova’s notes

The correlation between errors for different individuals in

different time periods. The covariance for this case is

cov , ( )

0 0 0 0 0

it js it js i it j js

i j i js it j it js

v v E v v E u e u e

E u u E u e E e u E e e

Page 41: Panel Data Models ECON 6002 Econometrics I Memorial University of Newfoundland Adapted from Vera Tabakova’s notes

2

2 2

cov( , )corr( , )

var( ) var( )it is u

it isu eit is

v vv v

v v

Page 42: Panel Data Models ECON 6002 Econometrics I Memorial University of Newfoundland Adapted from Vera Tabakova’s notes

1 2 2 3 3it it it ity x x e

1 2 2 3 3it it it ite y b b x b x

2

1 1

2

1 1

ˆ1

2 1 ˆ

N T

iti t

N T

iti t

eNT

LMT e

Page 43: Panel Data Models ECON 6002 Econometrics I Memorial University of Newfoundland Adapted from Vera Tabakova’s notes

* * * * *1 1 2 2 3 3it it it it ity x x x v

* * * *1 2 2 2 3 3 3, 1 , ,it it i it it it i it it iy y y x x x x x x x

2 21 e

u eT

Page 44: Panel Data Models ECON 6002 Econometrics I Memorial University of Newfoundland Adapted from Vera Tabakova’s notes

2 2

ˆ .1951ˆ 1 1 .7437

5 .1083 .0381ˆ ˆe

u eT

Page 45: Panel Data Models ECON 6002 Econometrics I Memorial University of Newfoundland Adapted from Vera Tabakova’s notes

Summary for now

Pooled OLS vs different intercepts: test (use a Chow type, after FE or run RE and test if the variance of the intercept component of the error is zero)

You cannot pool onto OLS? Then…

FE vs RE: test (Hausman type)

Different slopes too perhaps? => use SURE of RCM and test for equality of slopes across units

Page 46: Panel Data Models ECON 6002 Econometrics I Memorial University of Newfoundland Adapted from Vera Tabakova’s notes

Summary for now

Note that there is within variation versus between variation

The OLS is an unweighted average of the between estimator and the within estimator

The RE is a weighted average of the between estimator and the within estimator

The FE is also a weighted average of the between estimator and the within estimator with zero as the weight for the between part

Page 47: Panel Data Models ECON 6002 Econometrics I Memorial University of Newfoundland Adapted from Vera Tabakova’s notes

Summary for now

The RE is a weighted average of the between estimator and the within estimator

The FE is also a weighted average of the between estimator and the within estimator with zero as the weight for the between part

So now you see where the extra efficiency of RE comes from!...

Page 48: Panel Data Models ECON 6002 Econometrics I Memorial University of Newfoundland Adapted from Vera Tabakova’s notes

Summary for now

The RE uses information from both the cross-sectional variation in the panel and the time series variation, so it mixes LR and and SR effects

The FE uses only information from the time series variation, so it estimates LR effects

Page 49: Panel Data Models ECON 6002 Econometrics I Memorial University of Newfoundland Adapted from Vera Tabakova’s notes

Summary for now

With a panel, we can learn about dynamic effects from a short panel, while we need a long time series on a single cross-sectional unit, to learn about dynamics from a time series data set

Page 50: Panel Data Models ECON 6002 Econometrics I Memorial University of Newfoundland Adapted from Vera Tabakova’s notes

If the random error is correlated with any of the right-

hand side explanatory variables in a random effects model then the

least squares and GLS estimators of the parameters are biased and

inconsistent.

it i itv u e

Page 51: Panel Data Models ECON 6002 Econometrics I Memorial University of Newfoundland Adapted from Vera Tabakova’s notes

1 2 2 3 31 1 1 1 1

1 2 2 3 3

1 1 1 1 1T T T T T

i it it it i itt t t t t

i i i i

y y x x u eT T T T T

x x u e

1 2 2 3 3 ( )it it it i ity x x u e

Page 52: Panel Data Models ECON 6002 Econometrics I Memorial University of Newfoundland Adapted from Vera Tabakova’s notes

1 2 2 3 3

1 2 2 3 3

2 2 2 3 3 3

( )

( ) ( ) ( )

it it it i it

i i i i i

it i it i it i it i

y x x u e

y x x u e

y y x x x x e e

Page 53: Panel Data Models ECON 6002 Econometrics I Memorial University of Newfoundland Adapted from Vera Tabakova’s notes

We expect to find

because Hausman proved that

, , , ,

1 2 1 22 2

, ,, ,se sevar var

FE k RE k FE k RE k

FE k RE kFE k RE k

b b b bt

b bb b

, ,var var 0.FE k RE kb b

, , , , , ,

, ,

var var var 2cov ,

var var

FE k RE k FE k RE k FE k RE k

FE k RE k

b b b b b b

b b

, , ,cov , var .FE k RE k RE kb b b

Page 54: Panel Data Models ECON 6002 Econometrics I Memorial University of Newfoundland Adapted from Vera Tabakova’s notes

The test statistic to the coefficient of SOUTH is:

Using the standard 5% large sample critical value of 1.96, we reject the hypothesis that the estimators yield identical results. Our conclusion is that the random effects estimator is inconsistent, and we should use the fixed effects estimator, or we should attempt to improve the model specification.

, ,

1 2 1 22 2 2 2

, ,

.0163 (.0818) 2.3137

.0361 .0224se se

FE k RE k

FE k RE k

b bt

b b

Page 55: Panel Data Models ECON 6002 Econometrics I Memorial University of Newfoundland Adapted from Vera Tabakova’s notes

If the random error is correlated with any of the right-

hand side explanatory variables in a random effects model then the

least squares and GLS estimators of the parameters are biased and

inconsistent.

Then we would have to use the FE model

But with FE we lose the static variables?

Solutions? HT, AM, BMS, instrumental variables models could help

it i itv u e

Page 56: Panel Data Models ECON 6002 Econometrics I Memorial University of Newfoundland Adapted from Vera Tabakova’s notes

We can generalise the random effects idea and allow for different

slopes too: Random Coefficients Model

Again, the now it is the slope parameters that differ, but as in RE

model, they are drawn from a common distribution

The RCM in a way is to the RE model what the SURE model is to the

FE model

Further issues

Page 57: Panel Data Models ECON 6002 Econometrics I Memorial University of Newfoundland Adapted from Vera Tabakova’s notes

Unit root tests and Cointegration in panels

Dynamics in panels

Further issues

Page 58: Panel Data Models ECON 6002 Econometrics I Memorial University of Newfoundland Adapted from Vera Tabakova’s notes

Of course it is not necessary that one of the dimensions of the panel is

time as such Example: i are students and t is for each quiz they take

Of course we could have a one-way effect model on the time

dimension instead

Or a two-way model

Or a three way model! But things get a bit more complicated there…

Further issues

Page 59: Panel Data Models ECON 6002 Econometrics I Memorial University of Newfoundland Adapted from Vera Tabakova’s notes

Another way to have more fun with panel data is to consider

dependent variables that are not continuous

Logit, probit, count data can be considered

STATA has commands for these

Based on maximum likelihood and other estimation techniques we

have not yet considered

Further issues

Page 60: Panel Data Models ECON 6002 Econometrics I Memorial University of Newfoundland Adapted from Vera Tabakova’s notes

You can understand the use of the FE model as a solution to omitted variable bias

If the unmeasured variables left in the error model are not correlated

with the ones in the model, we would not have a bias in OLS, so we

can safely use RE

If the unmeasured variables left in the error model are correlated with

the ones in the model, we would have a bias in OLS, so we cannot

use RE, we should not leave them out and we should use FE, which

bundles them together in each cross-sectional dummy

Further issues

Page 61: Panel Data Models ECON 6002 Econometrics I Memorial University of Newfoundland Adapted from Vera Tabakova’s notes

Another criterion to choose between FE and RE

If the panel include all the relevant cross-sectional units, use FE, if only a random sample from a population, RE is more appropriate (as long as it is valid)

Further issues

Page 62: Panel Data Models ECON 6002 Econometrics I Memorial University of Newfoundland Adapted from Vera Tabakova’s notes

Wooldridge’s book on panel data

Baltagi’s book on panel data

Greene’s coverage is also good

Readings

Page 63: Panel Data Models ECON 6002 Econometrics I Memorial University of Newfoundland Adapted from Vera Tabakova’s notes

Slide 15-63Principles of Econometrics, 3rd Edition

Page 64: Panel Data Models ECON 6002 Econometrics I Memorial University of Newfoundland Adapted from Vera Tabakova’s notes

Slide 15-64Principles of Econometrics, 3rd Edition

Page 65: Panel Data Models ECON 6002 Econometrics I Memorial University of Newfoundland Adapted from Vera Tabakova’s notes

Principles of Econometrics, 3rd Edition Slide 15-65

(15A.1)

(15A.2)

(15A.3)

1 2 2 3 3 ( )it it it i ity x x u e

2 2 2 3 3 3( ) ( ) ( )it i it i it i it iy y x x x x e e

2ˆ DVe

slopes

SSE

NT N K

Page 66: Panel Data Models ECON 6002 Econometrics I Memorial University of Newfoundland Adapted from Vera Tabakova’s notes

Principles of Econometrics, 3rd Edition Slide 15-66

(15A.4)

(15A.5)

1 2 2 3 3 1, ,i i i i iy x x u e i N

1

22 2

2 21

22

var var var var var

1var

T

i i i i i itt

Te

u it ut

eu

u e u e u e T

Te

T T

T

Page 67: Panel Data Models ECON 6002 Econometrics I Memorial University of Newfoundland Adapted from Vera Tabakova’s notes

Principles of Econometrics, 3rd Edition Slide 15-67

(15A.6)

(15A.7)

22 e BEu

BE

SSE

T N K

2 2

2 2 ˆˆ e e BE DV

u uBE slopes

SSE SSE

T T N K T NT N K