Econometric Methods for Panel Data · Econometric Methods for Panel Data Based on the books by...

21
. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1/21 Introduction Fixed effects Random effects Two-way panels Tests in panel models Coefficients of determination in panels Econometric Methods for Panel Data Based on the books by Baltagi: Econometric Analysis of Panel Data and by Hsiao: Analysis of Panel Data Robert M. Kunst [email protected] University of Vienna and Institute for Advanced Studies Vienna April 25, 2018 Econometric Methods for Panel Data University of Vienna and Institute for Advanced Studies Vienna

Transcript of Econometric Methods for Panel Data · Econometric Methods for Panel Data Based on the books by...

Page 1: Econometric Methods for Panel Data · Econometric Methods for Panel Data Based on the books by Baltagi: Econometric Analysis of Panel Data and by Hsiao: Analysis of Panel Data Robert

...

.

...

.

...

.

...

.

...

.

...

.

...

.

...

.

...

.

...

.1/21

Introduction Fixed effects Random effects Two-way panels Tests in panel models Coefficients of determination in panels

Econometric Methods for Panel DataBased on the books by Baltagi: Econometric Analysis of

Panel Data and by Hsiao: Analysis of Panel Data

Robert M. [email protected]

University of Viennaand

Institute for Advanced Studies Vienna

April 25, 2018

Econometric Methods for Panel Data University of Vienna and Institute for Advanced Studies Vienna

Page 2: Econometric Methods for Panel Data · Econometric Methods for Panel Data Based on the books by Baltagi: Econometric Analysis of Panel Data and by Hsiao: Analysis of Panel Data Robert

...

.

...

.

...

.

...

.

...

.

...

.

...

.

...

.

...

.

...

.2/21

Introduction Fixed effects Random effects Two-way panels Tests in panel models Coefficients of determination in panels

OutlineIntroduction

Fixed effects

Random effects

Two-way panels

Tests in panel modelsPoolability testsTesting for the presence of random effectsThe Hausman test

Coefficients of determination in panels

Econometric Methods for Panel Data University of Vienna and Institute for Advanced Studies Vienna

Page 3: Econometric Methods for Panel Data · Econometric Methods for Panel Data Based on the books by Baltagi: Econometric Analysis of Panel Data and by Hsiao: Analysis of Panel Data Robert

...

.

...

.

...

.

...

.

...

.

...

.

...

.

...

.

...

.

...

.3/21

Introduction Fixed effects Random effects Two-way panels Tests in panel models Coefficients of determination in panels

Poolability tests

The hypotheses of poolability tests

These tests help select the panel model to be estimated, within theframework of fixed-effects models. For example:

I Are there individual effects or is it preferable to ignore themand to estimate by pooled OLS?

I Are there time effects on top of the individual effects?I Are the coefficients β really constant across individuals?

These tests follow a simple principle: restricted and unrestrictedmodels are compared via LR or Wald statistics. In most cases, nulldistributions are F or χ2, with degrees of freedom matching thenumber of restrictions.

Econometric Methods for Panel Data University of Vienna and Institute for Advanced Studies Vienna

Page 4: Econometric Methods for Panel Data · Econometric Methods for Panel Data Based on the books by Baltagi: Econometric Analysis of Panel Data and by Hsiao: Analysis of Panel Data Robert

...

.

...

.

...

.

...

.

...

.

...

.

...

.

...

.

...

.

...

.4/21

Introduction Fixed effects Random effects Two-way panels Tests in panel models Coefficients of determination in panels

Poolability tests

Testing for individual effects

Here, the null model (restricted) is

yit = α+ β′Xit + νit,

with iid errors, and the alternative (unrestricted) model is

yit = α+ β′Xit + µi + νit,

assuming∑N

i=1 µi = 0. The null hypothesis may be written as:

H0 : µi = 0, i = 1, . . . ,N.

Econometric Methods for Panel Data University of Vienna and Institute for Advanced Studies Vienna

Page 5: Econometric Methods for Panel Data · Econometric Methods for Panel Data Based on the books by Baltagi: Econometric Analysis of Panel Data and by Hsiao: Analysis of Panel Data Robert

...

.

...

.

...

.

...

.

...

.

...

.

...

.

...

.

...

.

...

.5/21

Introduction Fixed effects Random effects Two-way panels Tests in panel models Coefficients of determination in panels

Poolability tests

Testing for individual effects: the statistic

The traditional restriction-test statistic is

F1−way =(ESSR − ESSU) / (N − 1)ESSU/ ((T − 1)N − K) ,

as there are N − 1 restrictions from the maintained hypothesis tothe null. There are (T − 1)N − K degrees of freedom in theunrestricted model. Under H0, this statistic will be distributed asFN−1,N(T−1)−K, assuming Gaussian errors.

Econometric Methods for Panel Data University of Vienna and Institute for Advanced Studies Vienna

Page 6: Econometric Methods for Panel Data · Econometric Methods for Panel Data Based on the books by Baltagi: Econometric Analysis of Panel Data and by Hsiao: Analysis of Panel Data Robert

...

.

...

.

...

.

...

.

...

.

...

.

...

.

...

.

...

.

...

.6/21

Introduction Fixed effects Random effects Two-way panels Tests in panel models Coefficients of determination in panels

Poolability tests

Other analogous tests

For the null of the pooled model and the alternative of the two-waymodel, the distribution of the F–statistic will be distributed asF(N+T−2,NT−N−T+1−K) under the null, assuming Gaussian errors.

For the null of the one-way individual-effects model and thealternative of the two-way model, the F–statistic will be distributedas F(T−1,NT−N−T+1−K) under the null, assuming Gaussian errors.

For large NT, χ2 versions may be used instead, which areindependent of Gaussian error assumptions.

Econometric Methods for Panel Data University of Vienna and Institute for Advanced Studies Vienna

Page 7: Econometric Methods for Panel Data · Econometric Methods for Panel Data Based on the books by Baltagi: Econometric Analysis of Panel Data and by Hsiao: Analysis of Panel Data Robert

...

.

...

.

...

.

...

.

...

.

...

.

...

.

...

.

...

.

...

.7/21

Introduction Fixed effects Random effects Two-way panels Tests in panel models Coefficients of determination in panels

Poolability tests

Testing homogeneity of individual slopesIn one specification, the unrestricted model is

yit = α+ β′i Xit + µi + νit,

and the null can be expressed as

H0 : β1 = . . . = βN = β, µ1 = . . . = µN = 0,

with (K + 1)(N − 1) restrictions. The unrestricted model has onlyN(T − K − 1) degrees of freedom. If this test rejects, either theone-way model should be considered or individuals must bemodelled separately. It may make more sense just to test theslopes, with K(N − 1) restrictions.

Econometric Methods for Panel Data University of Vienna and Institute for Advanced Studies Vienna

Page 8: Econometric Methods for Panel Data · Econometric Methods for Panel Data Based on the books by Baltagi: Econometric Analysis of Panel Data and by Hsiao: Analysis of Panel Data Robert

...

.

...

.

...

.

...

.

...

.

...

.

...

.

...

.

...

.

...

.8/21

Introduction Fixed effects Random effects Two-way panels Tests in panel models Coefficients of determination in panels

Poolability tests

Constellations in panel models and degrees of freedom

coefficients βeffects name β βi

α OLS NT − K − 1 N(T − K)− 1αi one-way N(T − 1)− K N(T − K − 1)αit two-way N(T − 1)− T + 1 − K N(T − K − 1)− T + 1

Econometric Methods for Panel Data University of Vienna and Institute for Advanced Studies Vienna

Page 9: Econometric Methods for Panel Data · Econometric Methods for Panel Data Based on the books by Baltagi: Econometric Analysis of Panel Data and by Hsiao: Analysis of Panel Data Robert

...

.

...

.

...

.

...

.

...

.

...

.

...

.

...

.

...

.

...

.9/21

Introduction Fixed effects Random effects Two-way panels Tests in panel models Coefficients of determination in panels

Poolability tests

The test by Roy and Zellner

Some researchers (among them, Baltagi) criticize that the usualF–test checks poolability in an otherwise perfect Gauss-Markovregression with Eνν ′ = σ2

νI. To cope with this problem, one mayalso test for βi = β and/or βt = β in a (one-way or two-way) REmodel.This test is called the Roy-Zellner test. Essentially, it tests for‘fixed-type’ poolability of slope coefficients in a random-effectsmodel.

Econometric Methods for Panel Data University of Vienna and Institute for Advanced Studies Vienna

Page 10: Econometric Methods for Panel Data · Econometric Methods for Panel Data Based on the books by Baltagi: Econometric Analysis of Panel Data and by Hsiao: Analysis of Panel Data Robert

...

.

...

.

...

.

...

.

...

.

...

.

...

.

...

.

...

.

...

.10/21

Introduction Fixed effects Random effects Two-way panels Tests in panel models Coefficients of determination in panels

Testing for the presence of random effects

Likelihood-ratio tests for variance parametersAssume Lu is the likelihood of an unrestricted model, Lr is thelikelihood of a restricted model. A lemma says that thelikelihood-ratio (LR) statistic

LR = 2 (log Lu − log Lr) ,

will be, under the null of the restricted model, asymptoticallydistributed χ2 with degrees of freedom matching the number ofrestrictions.

The lemma requires several regularity conditions. In testing avariance parameter for zero, these conditions are violated and theproperty is not guaranteed to hold.

Econometric Methods for Panel Data University of Vienna and Institute for Advanced Studies Vienna

Page 11: Econometric Methods for Panel Data · Econometric Methods for Panel Data Based on the books by Baltagi: Econometric Analysis of Panel Data and by Hsiao: Analysis of Panel Data Robert

...

.

...

.

...

.

...

.

...

.

...

.

...

.

...

.

...

.

...

.11/21

Introduction Fixed effects Random effects Two-way panels Tests in panel models Coefficients of determination in panels

Testing for the presence of random effects

LR test for random effects in two-way panels

The unrestricted RE model

yit = α+ β′Xit + uit,

uit = µi + λt + νit,

with the restricted null H0 : σ2µ = σ2

λ = 0 violates the regularityconditions. The LR test statistic has the non-standard distribution

14χ

2(0) + 12χ

2(1) + 14χ

2(2),

where χ2(0) denotes point mass at zero.

Econometric Methods for Panel Data University of Vienna and Institute for Advanced Studies Vienna

Page 12: Econometric Methods for Panel Data · Econometric Methods for Panel Data Based on the books by Baltagi: Econometric Analysis of Panel Data and by Hsiao: Analysis of Panel Data Robert

...

.

...

.

...

.

...

.

...

.

...

.

...

.

...

.

...

.

...

.12/21

Introduction Fixed effects Random effects Two-way panels Tests in panel models Coefficients of determination in panels

Testing for the presence of random effects

LR test for random effects in one-way panels

The unrestricted RE model

yit = α+ β′Xit + uit,

uit = µi + νit,

with the restricted null H0 : σ2µ = 0 again violates the regularity

conditions. The LR test statistic has the non-standard distribution12χ

2(0) + 12χ

2(1).

An analogous test can be used for random time effects. Thesetests are due to Gourieroux, Holly & Monfort.

Econometric Methods for Panel Data University of Vienna and Institute for Advanced Studies Vienna

Page 13: Econometric Methods for Panel Data · Econometric Methods for Panel Data Based on the books by Baltagi: Econometric Analysis of Panel Data and by Hsiao: Analysis of Panel Data Robert

...

.

...

.

...

.

...

.

...

.

...

.

...

.

...

.

...

.

...

.13/21

Introduction Fixed effects Random effects Two-way panels Tests in panel models Coefficients of determination in panels

Testing for the presence of random effects

LM tests for random effects

Lagrange-multiplier (LM) tests have standard χ2 asymptotics.They have usually less power. One may test for two-way randomeffects using pooled-OLS residuals u by LM:

LM = LM1 + LM2,

LM1 =NT

2 (T − 1)

1 − u′ (IN ⊗ JT) u

u′u

2,

LM2 =NT

2 (N − 1)

1 − u′ (JN ⊗ IT) u

u′u

2,

or one may test for one-way effects by using LM1 or LM2. Thistest is due to Breusch & Pagan.

Econometric Methods for Panel Data University of Vienna and Institute for Advanced Studies Vienna

Page 14: Econometric Methods for Panel Data · Econometric Methods for Panel Data Based on the books by Baltagi: Econometric Analysis of Panel Data and by Hsiao: Analysis of Panel Data Robert

...

.

...

.

...

.

...

.

...

.

...

.

...

.

...

.

...

.

...

.14/21

Introduction Fixed effects Random effects Two-way panels Tests in panel models Coefficients of determination in panels

The Hausman test

The Hausman test principle

Hausman tests can be used in all situations where two modelspecifications and two estimators are available with the followingproperties:

1. In the restricted model (null), the estimator θ is efficient, theestimator θ is consistent though typically not efficient;

2. in the unrestricted model (alternative), the estimator θ isinconsistent, the estimator θ is consistent.

Then, the difference q = θ − θ should diverge under the alternativeand it should converge to zero under the null. Moreover, under thenull q and θ should be uncorrelated.

Econometric Methods for Panel Data University of Vienna and Institute for Advanced Studies Vienna

Page 15: Econometric Methods for Panel Data · Econometric Methods for Panel Data Based on the books by Baltagi: Econometric Analysis of Panel Data and by Hsiao: Analysis of Panel Data Robert

...

.

...

.

...

.

...

.

...

.

...

.

...

.

...

.

...

.

...

.15/21

Introduction Fixed effects Random effects Two-way panels Tests in panel models Coefficients of determination in panels

The Hausman test

The RE and the FE model

The null of the RE and the alternative of the FE model correspondto the Hausman situation:

1. In the RE model, the GLS-type RE estimator is efficient byconstruction for Gaussian errors, the FE estimator and eventhe OLS estimator are consistent;

2. in the FE model, the RE estimator is inconsistent, because ofthe omitted-variable effect, while FE is consistent byconstruction.

Econometric Methods for Panel Data University of Vienna and Institute for Advanced Studies Vienna

Page 16: Econometric Methods for Panel Data · Econometric Methods for Panel Data Based on the books by Baltagi: Econometric Analysis of Panel Data and by Hsiao: Analysis of Panel Data Robert

...

.

...

.

...

.

...

.

...

.

...

.

...

.

...

.

...

.

...

.16/21

Introduction Fixed effects Random effects Two-way panels Tests in panel models Coefficients of determination in panels

The Hausman test

Two views on the RE inconsistency in the FE model

1. The estimator (X′Ω−1X)−1X′Ω−1y is inconsistent, if the truemodel is y = Xβ + Zµµ+ ν, as the regressors Zµ are omitted;

2. Mundlak showed that the RE estimator for a stochasticregression model with X and Zµ correlated is identical to theFE estimator: the RE estimator imposes independence ofeffects and covariates.

Some argue, however, that Mundlak’s alternative is not reallythe same concept as the fixed-effects model.

Econometric Methods for Panel Data University of Vienna and Institute for Advanced Studies Vienna

Page 17: Econometric Methods for Panel Data · Econometric Methods for Panel Data Based on the books by Baltagi: Econometric Analysis of Panel Data and by Hsiao: Analysis of Panel Data Robert

...

.

...

.

...

.

...

.

...

.

...

.

...

.

...

.

...

.

...

.17/21

Introduction Fixed effects Random effects Two-way panels Tests in panel models Coefficients of determination in panels

The Hausman test

The Hausman test statistic

The Hausman test statistic is defined as

m = q′(varβFE − varβRE)−1q,

with q = βFE − βRE. Under RE, the matrix difference in brackets ispositive, as the RE estimator is efficient and any other estimatorhas a larger variance.The statistic m is distributed χ2 under the null of RE, with degreesof freedom determined by the dimension of β, K.

Econometric Methods for Panel Data University of Vienna and Institute for Advanced Studies Vienna

Page 18: Econometric Methods for Panel Data · Econometric Methods for Panel Data Based on the books by Baltagi: Econometric Analysis of Panel Data and by Hsiao: Analysis of Panel Data Robert

...

.

...

.

...

.

...

.

...

.

...

.

...

.

...

.

...

.

...

.18/21

Introduction Fixed effects Random effects Two-way panels Tests in panel models Coefficients of determination in panels

R2 in a panel model

Should the variation due to effects be part of the explainedvariation or not? If yes, the R2 has little to say on the importanceof the substantial covariates β.There is no unanimous agreement on which R2 to report in apanel. Some programs (STATA etc.) follow the suggestion byWooldridge and report three measures: within R2, between R2,and overall R2.

Econometric Methods for Panel Data University of Vienna and Institute for Advanced Studies Vienna

Page 19: Econometric Methods for Panel Data · Econometric Methods for Panel Data Based on the books by Baltagi: Econometric Analysis of Panel Data and by Hsiao: Analysis of Panel Data Robert

...

.

...

.

...

.

...

.

...

.

...

.

...

.

...

.

...

.

...

.19/21

Introduction Fixed effects Random effects Two-way panels Tests in panel models Coefficients of determination in panels

The within R2

For the within R2, the total sum of squares TSS is defined as

TSS =N∑

i=1

T∑t=1

(yit − yi)2 ,

i.e. after adjusting for effects. Then, also residuals in the residualsum of squares ESS rely on the ‘purged’ model, and the statistic

1 − ESSTSS

is maximized by LSDV or the FE estimator.

Econometric Methods for Panel Data University of Vienna and Institute for Advanced Studies Vienna

Page 20: Econometric Methods for Panel Data · Econometric Methods for Panel Data Based on the books by Baltagi: Econometric Analysis of Panel Data and by Hsiao: Analysis of Panel Data Robert

...

.

...

.

...

.

...

.

...

.

...

.

...

.

...

.

...

.

...

.20/21

Introduction Fixed effects Random effects Two-way panels Tests in panel models Coefficients of determination in panels

The between R2

For the between R2, the total sum of squares TSS is defined as

TSS =N∑

i=1(yi − y)2 ,

i.e. just N individual time averages. Residuals in the residual sumof squares ESS also rely on the between model with Nobservations, and the statistic

1 − ESSTSS

is maximized by the between estimator.

Econometric Methods for Panel Data University of Vienna and Institute for Advanced Studies Vienna

Page 21: Econometric Methods for Panel Data · Econometric Methods for Panel Data Based on the books by Baltagi: Econometric Analysis of Panel Data and by Hsiao: Analysis of Panel Data Robert

...

.

...

.

...

.

...

.

...

.

...

.

...

.

...

.

...

.

...

.21/21

Introduction Fixed effects Random effects Two-way panels Tests in panel models Coefficients of determination in panels

The overall R2

Finally, the overall R2 relies on the usual TSS definition

TSS =T∑

t=1

N∑i=1

(yit − y)2 ,

and on residuals calculated without accounting for effects. It ismaximized by pooled OLS.Values for the three R2 may be compared. For example, if withinand overall R2 are close, this is evidence for individual effects beingnot so important etc.

Econometric Methods for Panel Data University of Vienna and Institute for Advanced Studies Vienna