Part I Ch 1. Linear Non Dynamic Panel Data Models · 2012. 10. 16. · 4.2 Linear Panel Data...

21
Topics in Applied Econometrics : Panel Data Pr. Philippe Polomé, Université Lumière Lyon 2 2012 – 2013 M2 Equade & M2 GAEXA Part I Ch 1. Linear Non Dynamic Panel Data Models 1 Panel Data Models A very general linear model for panel data permits the intercept and slope coefficients to vary over both individual and time, with y it = α it + x it β it + u it , i =1, ..., N , t =1, ..., T where y it is a scalar dependent variable, x it is a K × 1 vector of independent variables, u it is a scalar disturbance term, i indexes individual (or firm or country) in a cross section, and t indexes time. 1.1 Pooled Model y it = α + x it β + u it (1) A simple variant of the pooled model (1) has – Intercepts that vary across individuals and over time – Constant slopes y it = α i + γ t + x it β + u it (2) 1

Transcript of Part I Ch 1. Linear Non Dynamic Panel Data Models · 2012. 10. 16. · 4.2 Linear Panel Data...

Page 1: Part I Ch 1. Linear Non Dynamic Panel Data Models · 2012. 10. 16. · 4.2 Linear Panel Data Estimates • The parameter λ is defined in the estimators section as λ =1− σ σ2

Topics in Applied Econometrics : Panel Data

Pr. Philippe Polomé, Université Lumière Lyon 2

2012 – 2013

M2 Equade & M2 GAEXA

Part I

Ch 1. Linear Non Dynamic Panel DataModels1 Panel Data Models

• A very general linear model for panel data permits the intercept and slope coefficients tovary over both individual and time, with

– yit = αit + x�

itβit + uit, i = 1, ..., N , t = 1, ..., T

– where yit is a scalar dependent variable,– xit is a K × 1 vector of independent variables,– uit is a scalar disturbance term,– i indexes individual (or firm or country) in a cross section, and– t indexes time.

1.1 Pooled Modelyit = α+ x

itβ + uit (1)

• A simple variant of the pooled model (1) has

– Intercepts that vary across individuals and over time– Constant slopes

yit = αi + γt + x�

itβ + uit (2)

1

Page 2: Part I Ch 1. Linear Non Dynamic Panel Data Models · 2012. 10. 16. · 4.2 Linear Panel Data Estimates • The parameter λ is defined in the estimators section as λ =1− σ σ2

1.2 Fixed Effects & Random Effects• Individual-specific effects model allows each cross-sectional unit to have a different inter-

cept term though all slopes are the same :

yit = αi + x�

itβ + �it (3)

where �it is iid over i and t

• Throughout this chapter we make the assumption of strong/strict exogeneity

E[εit|αi, xi1, ..., xiT ] = 0, t = 1, ..., T (4)

• One variant of the model (3) treats αi as an unobserved random variable that is potentiallycorrelated with the observed regressors xit : fixed effects

• The other variant of the model (3) assumes that the unobservable individual effects αi arerandom variables that are distributed independently of the regressors x : random effects

– Usually makes the additional assumptions that both the random effects αi and the errorterm �it in (3) are iid :

αi ∼�α,σ2

α

�it ∼�0,σ2

� (5)

• The RE model yit = αi + x�

itβ + �it can be viewed as regression of yit on xit with compositeerror term uit = αi + εit , and RE hypothesis (5) implies that

Cov[(αi + εit), (αi + εis)] =�σ�2α, t �= sσ�2α + σ�

2ε , t = s

(6)

1.3 Fixed vs. Random Effects• For the RE model it is assumed that E[ci|xit] = α, so E[yit|xit] = α+ x�

itβ hence E[yit|xit] isidentified

• In the FE model, E[ci|xit] varies with xit and it is not known how it varies, so we cannotidentify E[yit|xit]

• Thus it is possible in the FE model to identify the marginal effect β = ∂E[yit|ci, xit]/∂xit

even though the conditional mean is not identified

• Synthesis of Panel Data Models

Pooled Model (1) yit = α+ x�

itβ + uit

Fixed-effects modelyit = αi + x

itβ + �it (3) Cov (αi, xit) �= 0

Random-effects model αi ∼�α,σ2

α

�it ∼�0,σ2

� (5)

2

Page 3: Part I Ch 1. Linear Non Dynamic Panel Data Models · 2012. 10. 16. · 4.2 Linear Panel Data Estimates • The parameter λ is defined in the estimators section as λ =1− σ σ2

2 Panel Data Estimators

2.1 Pooled OLS Estimator• Stacking the data over i and t into one long regression with NT observations

• Estimating by OLS yit = α+ x�itβ+ uit, i = 1, ..., N, t = 1, ..., T

• If Cov[uit, xit] = 0 then either N → ∞ or T → ∞ is sufficient for consistency

2.2 Between Estimator• The Between model

yi = α+ x�

iβ + (αi − α+ �i) i = 1, ..., N (7)

• where yi = T−1�

t yit, εi = T−1�

t εit , and xi = T−1�

t xit (arithmetic means over time,per individual)

• Between is consistent if the regressors xi are independent of the composite error (αi−α+ εi)in (7)

2.3 Within (Fixed Effects) Estimator• Subtracting yields the within model as the αi terms cancel :

yit − yi = (xit − xi)�β + (�it − �i)

1, ..., N, t = 1, ..., T(8)

• Within estimator is the OLS estimator of yit − yi = (xit − xi)�β + (�it − �i) Consistent for β

in the FE model

2.4 First-Differences Estimator• Subtracting yields the first-differences model

yit − yi,t−1 = (xit − xi,t−1)�β + (�it − �i,t−1)

i = 1, ..., N, t = 2, ..., T(9)

• The First-differences estimator is Pooled OLS in the first differences model (9)

• Consistent estimates of β in the FE model

3

Page 4: Part I Ch 1. Linear Non Dynamic Panel Data Models · 2012. 10. 16. · 4.2 Linear Panel Data Estimates • The parameter λ is defined in the estimators section as λ =1− σ σ2

Table 1: Linear Panel Model: Common Estimators and ModelsAssumed Model

Estimator of β Pooled (1) Rnd Effects (3) & (5) Fixed Effects (3)

Pooled OLS (1) Consistent Consistent Inconsistent

Between (7) Consistent Consistent Inconsistent

Within (Fixed Effects) (8) Consistent Consistent Consistent

First Differences (9) Consistent Consistent Consistent

Random Effects (10) Consistent Consistent Inconsistent

2.5 Random Effects Estimator• The feasible GLS estimator of the RE model, called the RE estimator, can be calculated from

OLS estimation of the transformed model :

yit − λyi =�1− λ

�µ+

�xit − λxi

��

β + νit (10)

where νit = (1−λ)αi + (εit−λεi) is asymptotically iid, and

• λ is consistent for

λ = 1− σ��σ2� + Tσ2

α

(11)

• RE is

– Fully efficient under the RE model, though the efficiency gain compared to PooledOLS (applied to the RE model) need not be great

– Inconsistent if the FE model is correct since then αi is correlated with xit

• Summary Models & Estimators

3 Panel Data Inference

3.1 Panel-Robust Inference• Rewrite the panel estimators as OLS estimation of θ in the following regression

yit = w�

itθ + uit (12)

• where different panel estimators correspond to different transformations yit , wit, and uit ofyit, w�

it =�1 x

it

�, and uit

• yit is a known function of only yi1, ..., yiT , and similarly for wit, and uit

– Pooled OLS : no transformation, θ =�α β

� ��.

4

Page 5: Part I Ch 1. Linear Non Dynamic Panel Data Models · 2012. 10. 16. · 4.2 Linear Panel Data Estimates • The parameter λ is defined in the estimators section as λ =1− σ σ2

– Within : yit = yit−yi, wit = xit−xi only for the time-varying regressors, θ equals thecoefficients of the time-varying regressors

– First-differences : yit = yit−yi,t−1, wit = xit−xi,t−1 only coeffficients of time-varyingregressors are identified

– RE : yit = yit−λyi and w�it = wit−λwi and θ =

�α β

� ��

• 3 representations of the OLS estimator are θOLS =

1.�W

�W

�−1W

�y

2.

�N�

i=1

W�

iWi

�−1 �

i

W�

iyi

3.

�N�

i=1

T�

t=1

witw�

it

�−1 �

i

t

wityit

• To consider consistency of θOLS , if the model is correctly specified then the usual algebrayields

θOLS = θ +�W

�W

�−1W

�u or

θOLS = θ +

�N�

i=1

W�

iWi

�−1 �

i

W�

iui

• Given independence over i the essential condition for consistency is E�W

iui

�= 0 : no

correlation of errors with regressors “within” each individual E�W

iui

�=

E

w11i · · · wq1i

.... . .

...w1Ti · · · wqT i

u1i...

uTi

= E

T�

t=1

w1tiuti

...T�

t=1

wqtiuti

• A sufficient assumption is that of strong exogeneity from the previous section (4) E[uit|wi1, ..., wiT ] =0, t = 1, ..., T as it implies E (uitwis) = 0 ∀s = 1 . . . T

• Assuming independence of errors over i, the asymptotic variance of θOLS is V�θOLS

�=

5

Page 6: Part I Ch 1. Linear Non Dynamic Panel Data Models · 2012. 10. 16. · 4.2 Linear Panel Data Estimates • The parameter λ is defined in the estimators section as λ =1− σ σ2

�N�

i=1

W�

iWi

�−1 �

i

W�

iE�uiu

i|Wi

�Wi

�N�

i=1

W�

iWi

�−1

• Panel-robust estimate of V�θOLS

�, controling for both serial correlation and heteroskedas-

ticity :�

V�θOLS

�=

�N�

i=1

W�

iWi

�−1 �

i

W�

iˆuiˆu

iWi

�N�

i=1

W�

iWi

�−1

(13)

where ˆui = yi − W�

3.2 Bootstrap Standard Errors• The panel bootstrap estimate of the variance matrix is then “empirical”

�VBoot

�θ�=

1

B − 1

B�

b=1

�θb − ¯θ

��θb − ¯θ

��

(14)

where ¯θ = B−1�

b θb

4 Hours & Wages Example

4.1 Introduction & Description• Model lnhrsit = αi + βlnwgit + εit

– Individual-specific effect αi simplified to α in some models– β measures the wage elasticity of labor supply– εit assumed to be independent over i, but may be correlated over t for given i

• The total variation of a series xit around its grand mean x can be decomposed as

N�

i=1

T�

t=1

(xit − x)2 =N�

i=1

T�

t=1

[(xit − xi) + (xi − x)]2

=N�

i=1

T�

t=1

(xit − xi)2 +

N�

i=1

T�

t=1

(xi − x)2

• This leads to within standard deviation sW and between standard deviation sB

• s2W = 1NT−N

N�

i=1

T�

t=1

(xit−xi)2

6

Page 7: Part I Ch 1. Linear Non Dynamic Panel Data Models · 2012. 10. 16. · 4.2 Linear Panel Data Estimates • The parameter λ is defined in the estimators section as λ =1− σ σ2

Table 2: Hours and Wages: Standard Linear Panel Model EstimatorsPOLS Between Within First Diff RE-GLS RE-MLE

α 7.44 7.48 7.22 .001 7.35 7.35

β .83 .067 .168 .109 .119 .12

Default se .009 .02 .019 .021 .014 .014

Robust se .029 .024 .09 .084 .051 –

Boot se ~.02 ~.024 ~.086 ~.068 ~.050 ~.0.50

R2.015 .021 .016 .005 .014 .014

σα .000 .181 .161 .162

σ� .283 .233 .233 .233

λ .000 – .624 – .585 .586

N 5320 532 5320 4788 5320 5320

• s2B = 1N−1

N�

i=1

(xi−x)2

s sW sB

lnhrs .29 .22 .18lwg .43 .19 .39

• s, sW , sB : respectively sample sample standard deviations, within and between

4.2 Linear Panel Data Estimates• The parameter λ is defined in the estimators section as λ = 1− σ��

σ2� + Tσ2

α

.

4.3 Residual Analysis• Consider the autocorrelation patterns of the data and of residuals

– e.g. for residuals uit = yit−yit the autocorrelation between period s and period t iscalculated as ρst = cst/

√cssctt, s, t = 1, ..., T , where the covariance estimate cst =

(N−1)−1 �i

�uit−¯ut

� �uis−¯us

�and ¯ut = N−1

�i uit

7

Page 8: Part I Ch 1. Linear Non Dynamic Panel Data Models · 2012. 10. 16. · 4.2 Linear Panel Data Estimates • The parameter λ is defined in the estimators section as λ =1− σ σ2

Hours & Wages: Autocorrelations of Pooled OLS Resid.u79 u80 u81 u82 u83 u84 u85 u86 u87 u88

upols79 1upols80 .33 1upols81 .44 .4 1upols82 .3 .31 .57 1upols83 .21 .23 .37 .47 1upols84 .2 .23 .32 .34 .64 1upols85 .24 .32 .41 .35 .39 .58 1upols86 .2 .19 .28 .25 .31 .35 .4 1upols87 .2 .32 .33 .29 .31 .34 .39 .35 1upols88 .16 .25 .3 .26 .21 .25 .34 .55 .53 1

Hours & Wages: Autocorrelations of Within Reg. Resid.u79 u80 u81 u82 u83 u84 u85 u86 u87 u88

ufe79 1ufe80 .1 1ufe81 .21 .08 1ufe82 0 -.04 .26 1ufe83 -.26 -.27 -.21 .01 1ufe84 -.26 -.27 -.3 -.2 .32 1ufe85 -.18 -.1 -.11 -.17 -.16 .17 1ufe86 -.19 -.25 -.26 -.27 -.17 -.14 -.08 1ufe87 -.15 -.05 -.16 -.2 -.24 -.21 -.09 -.09 1ufe88 -.17 -.11 -.14 -.18 -.38 -.31 .13 .24 .24 1

5 Fixed Effects vs. Random Effects

5.1 Non-Test Elements of Choice Between FE and RE

5.2 Hausman Test• H0 : No systematic difference between the coefficients estimates

• Generally, consider two estimators θ and θ

– We test H0 : plim�θ−θ

�= 0 , Ha : plim

�θ−θ

��= 0

– Under H0, the difference between the 2 estimators converges to a normal with zeromean :

√N

�θ − θ

�→ N [0, VH ]

∗ where VH is the variance matrix in the limiting distribution

8

Page 9: Part I Ch 1. Linear Non Dynamic Panel Data Models · 2012. 10. 16. · 4.2 Linear Panel Data Estimates • The parameter λ is defined in the estimators section as λ =1− σ σ2

– The Hausman test statistic H =�θ − θ

�� �N−1VH

�−1 �θ − θ

�is asymptotically

χ2 (q) under H0

∗ reject H0 at level α if H > χ2α (q)

• Large value of H leads to rejection of the null hypothesis so that the individual-specific effectsare uncorrelated with regressors and to the conclusion that FE are present

Hausman Test Computation When RE IS Fully Efficient

• Assume that the true model is the RE model with αi iid�0,σ�2α

�uncorrelated with regressors

and error εit iid�0,σ�2ε

• Then the estimator βRE is fully efficient, the Hausman test statistic simplifies to

H =�β1,RE−β1,W

���

�V�β1,W

�− �V�β1,RE

��−1 �β1,RE−β1,W

Hausman Test When RE Is NOT Fully Efficient

• The simple form of the Hausman test is invalid if αi or εit are not iid, e.g with heteroskedas-ticity inherent in much microeconometrics data

• Then the RE estimator is not fully efficient under the null hypothesis

• The expression�

V�β1,W

�−

�V�β1,RE

�in the formula for H needs to be replaced by the more

general�

V�β1,RE − β1,W

• A panel-robust Hausman test statistic is

HRobust =�β1,RE−β1,W

���

�Vboot

�β1,RE − β1,W

��−1 �β1,RE−β1,W

where�

Vboot

�β1,RE − β1,W

�= 1

B−1

B�

b=1

�δb − ¯δ

��δb − ¯δ

��

and b denotes the bth of B bootstrap

replications and δ = β1,RE − β1,W

Hausman Test Example

• Richer Models for Random Effects

9

Page 10: Part I Ch 1. Linear Non Dynamic Panel Data Models · 2012. 10. 16. · 4.2 Linear Panel Data Estimates • The parameter λ is defined in the estimators section as λ =1− σ σ2

6 Practical Issues

6.1 Pooling

6.2 Individual-Specific Effects

6.3 Prediction• Prediction in models without individual effects is straightforward

• Prediction for a given individual conditional on the individual-specific effect is more difficult

– Consider out-of-sample forecasts for the ith individual using the RE model yit = w�

itδ +αi+ �it where w contains a vector of ones to ensure that the random effects αi have zeromean

– Then yi,t+s = w�it+sδ+ ui,t+s, where ui,t+s = αi + εi,t+s

– The obvious predictor replaces δ by δRE and ui,t+s by either 0 or ¯iu, where ¯ui =

yi−w�i δRE is the average within-sample residual for the ith individual

– However, this is inefficient as it ignores the correlation between ui,t+s and in-sampleerrors induced by the individual-specific random effect αi

• For this RE the best linear unbiased predictor can be shown to be yi,t+s = x�it+sδRE +

Tσ�2αTσ�2α + σ2

¯ui. The fraction is estimated by the term λ, see the RE estimator

• For the FE model the obvious predictor is yi,t+s = x�it+sβW + αi,W where αi,W = yi − x

iβW

is the within estimator of the individual FE, Obtained by secondary calculations from thewithin “primary” estimates βW . But (as indicated) these αi estimates are inconsistent inshort panels, Thus individual prediction is always “inconsistent” in FE

6.4 Unbalanced Panel Data

10

Page 11: Part I Ch 1. Linear Non Dynamic Panel Data Models · 2012. 10. 16. · 4.2 Linear Panel Data Estimates • The parameter λ is defined in the estimators section as λ =1− σ σ2

Part II

Linear Panel Models : EndogenousRegressors & GMM1 GMM Estimation of Linear Panel Models

1.1 GMM Theory in Cross-Sections

Analogy PrincipleµMM = N−1�N

i=1 yi = yLinear (Cross-Section) Regression

• E�x�y − x

��

= 0 if the error has conditional mean zero [is “exogenous”]

• The MM estimator is the solution to the corresponding sample moment condition : 1N

N�

i=1

xi

�yi − x

iβ�= 0

• This yields βMM =��

i x�

ixi

�−1 �i x

iyi

Linear IV

• Consider the case in which it is assumed that E [u|x] �= 0 because of endogeneity

• Assume we have a set of instruments z such that E [u|z] = 0 and

– The instruments are good (strongly correlated with the regressors)– dim (z) = dim (x) : there is exactly one instrument per regressor (exactly-identified

model)

• Then βMM =��

i z�

ixi

�−1 �i z

iyi is consistent while βOLS =��

i x�

ixi

�−1 �i x

iyi is incon-sistent

Additional Moment Restrictions

• Consider that dim (z) > dim (x) : there are more instruments than regressors

• The GMM estimator chooses β to make the vector of sample moment conditions 1N

�i zi

�yi − x

iβ�

as small as possible in quadratic terms, that is βGMM minimizes :

QN (β) =

�1

N

i

zi�yi − x

i�

WN

�1

N

i

zi�yi − x

i�

where WN is a weighting matrix

11

Page 12: Part I Ch 1. Linear Non Dynamic Panel Data Models · 2012. 10. 16. · 4.2 Linear Panel Data Estimates • The parameter λ is defined in the estimators section as λ =1− σ σ2

1.2 Linear Panel GMMPanel Assumptions

• Consider the linear panel model

yit = xitβ + uit (1)

where the regressors xit may have both time-varying and time-invariant components and mayinclude an intercept

Panel GMM Moment Conditions

• Assume the existence of a T × r matrix of instruments Zi

E�Z

iui

�= 0 (2)

• The GMM estimator based on these moment conditions minimizes the associated quadraticform

QN (β) =

�1

N

i

Zi

�yi −X

i�

WN

�1

N

i

Zi

�yi −X

i�

where WN is the r × r weighting matrix

Panel GMM Estimator

• Algebra yields the Panel GMM estimator βPGMM =

���

i

X�

iZi

�WN

��

i

Z�

iXi

��−1 ��

i

X�

iZi

�WN

��

i

Z�

iyi

• In the just-identified case of r = K, that is dim (z) = dim (x)

– βPGMM simplifies to the IV estimator [Z�X]−1Z

�y for any WN

βIV =

���

i

X�

iZi

���

i

Z�

iXi

��−1 ��

i

X�

iZi

���

i

Z�

iyi

Overidentified Panel GMM

12

Page 13: Part I Ch 1. Linear Non Dynamic Panel Data Models · 2012. 10. 16. · 4.2 Linear Panel Data Estimates • The parameter λ is defined in the estimators section as λ =1− σ σ2

• In many applications Zi is composed of current and lagged values of exogenous regressors

– The model is over-identified, and more efficient estimation is possible using the PGMMestimator

One-Step Panel GMM

• The one-step GMM or two-stage least-squares estimator uses weighting matrix WN =�Z

�Z�−1

leading to

β2SLS =

�X

�Z�Z

�Z�−1

Z�X

�−1

X�Z�Z

�Z�−1

Z�y (3)

Two-Step Panel GMM

• The most efficient GMM estimator based on the unconditional moment condition (2) usesweighting matrix WN = S−1

– Where S is consistent for the r × r matrix S = plim 1N

�i Z

iuiu�

iZi

• The two-step GMM estimator is then

β2SGMM =�X

�ZS−1Z

�X�−1

X�ZS−1Z

�y (4)

Panel-Robust Statistical Inference

1.3 Instruments & Exogeneity• Contemporaneous exogeneity E[zituit] = 0, t = 1, ..., T where zit is r × 1 : r moment

conditions per period

• Define

Zi =

z�

i1 0 · · · 0

0 z�

i2

......

. . . 00 · · · 0 z

iT

, ui =

ui1

ui2...

uiT

(5)

where Zi is thus now T × Tr

• Consider the moments condition (2), that is E�Z

iui

�= 0

Weak Exogeneity Assumption

• Stronger assumption : weak exogeneity assumption or predetermined instruments as-sumption :

13

Page 14: Part I Ch 1. Linear Non Dynamic Panel Data Models · 2012. 10. 16. · 4.2 Linear Panel Data Estimates • The parameter λ is defined in the estimators section as λ =1− σ σ2

– additionally lagged values of the instruments are uncorrelated with the current-perioderror, so that

E[zisuit] = 0, s ≤ t, t = 1, ..., T (6)

Strong Exogeneity Assumption

• Strong exogeneity : future values of instruments are also uncorrelated with the currentperiod error, so that

E[zisuit] = 0, s, t = 1, . . . . T (7)

2 Random and Fixed Effects Panel GMM

2.1 Introduction & Assumptions• Augment model (1) yit = xitβ + uit by including a time-invariant additive individual-specific

effect αi, so

yit = αi + x�

itβ + �it (8)

• Some components of the regressors xit are assumed to be endogenous, with E [xit (αi + �it)] �=0

• In this chapter with endogenous regressors, a model is :

• RE if instruments Zi exist that satisfy E�Z

i (αi + �it)�= 0

• FE if it is possible only to find instruments s.t. E�Z

i�it�= 0, but E

�Z

iαi

��= 0

2.2 Panel GMM Estimators for the FE modelPGMM for Fixed Effects Models

• The differencing operations in the previous chapter applied to (8) yit = αi + x�

itβ + �it leadto a transformed model of the form yit = x

itβ + �it

yi = Xiβ + �i (9)

Panel GMM for the First-Differences Model

• The first-differences PGMM estimator is the IV / 2SLS / 2SGMM estimator of thefirst-differences model

yit − yi,t−1 = (xit − xi,t−1)�β + (�it − �i,t−1) (10)

Panel GMM for the Within Model

• The within PGMM estimator is the IV / 2SLS / 2SGMM estimator of the within model(“FE”) model

yit − yi = (xit − xi)�β + (�it − �i) (11)

14

Page 15: Part I Ch 1. Linear Non Dynamic Panel Data Models · 2012. 10. 16. · 4.2 Linear Panel Data Estimates • The parameter λ is defined in the estimators section as λ =1− σ σ2

2.3 PGMM Estimators for the RE model• Consider the transformed model

yit − λyi =�xit − λxi

��

β +��

1− λ�αi +

��it − λ�i

��(12)

where λ is a consistent estimate of λ = 1− σ�/�σ2� + Tσ2

α

3 Hours & Wages Example

3.1 Model & Results• Use the same hours & wages dataset as in Ch. 1, with additional regressors to show the use

of instruments

lnhrsit = αi + β1lnwgit + β2childit + β3ageit + β4age2it + β5badhit + εit

Results with 1st-differencesPooled OLS 2SLSa 2SLSb

β1 .12 .19 .06Default se .024 .034 .065Default p .000 .000 .373

Bootstrap se .11 .134 .17Boot p-val .28 .161 .74

# obs 3724

1st-diff Stata Commands2SLSa : xtivreg lnhrs child age age2 badh (lnwg = childD1 ageD1 age2D1 badhD1 lnwgD2 childD2 ageD2 age2D2

badhD2), fd vce(bootstrap, reps(500))

2SLSb : idem but uses instruments in level : childL1... lnwgL1, childL2...

Pooled OLS : as 2SLSa with option regress

Results with WithinPooled OLS 2SLSa 2SLSb

β1 .17 -.41 -.19Default se .02 .57 .45Default p .000 .48 .68

Bootstrap se .09 .73 .44Boot p-val .06 .58 .67

# obs 4788 4256

• by i, sort : egen float lnhrsM = mean(lnhrs)

– generate lnhrsW = lnhrs-lnhrsM– & so on for the other variables

15

Page 16: Part I Ch 1. Linear Non Dynamic Panel Data Models · 2012. 10. 16. · 4.2 Linear Panel Data Estimates • The parameter λ is defined in the estimators section as λ =1− σ σ2

– Then lag the instruments by i, sort : gen childWL1 = childW[_n-1]

2SLSa : xtivreg lnhrs child age age2 badh (lnwg = childWL1 ageWL1 age2WL1 badhWL1), fe

2SLSb : xtivreg lnhrs child age age2 badh (lnwg = childL1 ageL1 age2L1 badhL1 childL2 ageL2 age2L2 badhL2),

fe vce(bootstrap, reps(500))

Pooled OLS : as 2SLSa with option regress

Random Effects Model

yit − λyi =�xit − λxi

��

β +��

1− λ�αi +

��it − λ�i

��(13)

where λ is a consistent estimate of λ = 1− σ�/�σ2� + Tσ2

α

Pooled OLS EC2SLSβ1 .12 -.13

Default se .15 .1Default p .000 .2

Bootstrap se .06 .15Boot p-val .047 .36

# obs 4256

EC2SLS : xtivreg lnhrs (lnwg child age age2 badh = childL1 ageL1 age2L1 badhL1 childL2ageL2 age2L2 badhL2), re ec2sls

Pooled OLS : idem with option regress

3.2 TestsWeak Instruments

Tests of Overidentifying Restrictions

OIR =

��

i

u�

iZi

��N S

���

i

Z�

iui

�∼ χ2

r−K

where ui = yi −X�

iβ2SGMM and independence over i is assumed

but heteroskedasticity and correlation over t for given i is permitted

• This test statistic is distributed as χ2r−K under the null hypothesis that the overidenti-fying restrictions are valid

4 Applications of Endogenous Regressors

4.1 Hausman–Taylor Model

yit = x�

1itβ1 + x�

2itβ2 +w�

1iγ1 +w�

2iγ2 + αi + �it (14)

16

Page 17: Part I Ch 1. Linear Non Dynamic Panel Data Models · 2012. 10. 16. · 4.2 Linear Panel Data Estimates • The parameter λ is defined in the estimators section as λ =1− σ σ2

where x1it and w1i are uncorrelated with αi but x2it and w2i are correlated with αi and wdenotes time-invariant regressors

• Consistent but inefficient estimation ignoring panel correlation structure of (αi + �it)

• x2i is correlated with αi but the within transformation x2it = x2it − x2i is not

– Since correlation with αi can only be on the time-invariant part of x2it ∀t– So x2it can be used as instrument for endogenous x2it

• The instrument for x1it is similarly x1it rather than the more obvious x1it

– because that separates x1it from its time-invariant part x1it

– Then x1i can be used as an instrument for endogenous w2i (could be weak)– Exogenous w1i is used as an instrument for itself

• Efficient HT estimation under the RE assumption that the components αi and �it are ho-moskedastic

– Then the RE differencing transformation leads to

yit = x1itβ1 + x2itβ2 + w1iγ1 + w2iγ2 + vit (15)

where, for example, x1it = x1it−λx1i

4.2 Dynamic Models

yit = γyi,t−1 + x�

itβ + αi + �it, i = 1, . . . , N, t = 1, . . . , T (16)

• From (16) with β = 0 so that yit = γyi,t−1 + αi + �it :

Cor [yit, yi,t−1] = Cor [γyi,t−1 + αi + �it, yi,t−1]= γCor [yi,t−1, yi,t−1] + Cor [αi, yi,t−1]

= γ +1− γ

1 + (1− γ)σ2� / (1 + γ)σ2

α

(17)

4.3 Dynamic Panel Estimators• First-difference model (16), t = 2, . . . , T

yit − yi,t−1 = γ (yi,t−1 − yi,t−2) + (xit − xi,t−1)�β + (�it − �i,t−1) (18)

• But IV estimation of (18) can use yi,t−2 as an instrument for (yi,t−1 − yi,t−2)

– yi,t−2 is a valid instrument since is not correlated with (�it − �i,t−1)

∗ assuming the errors �it are serially uncorrelated

– yi,t−2 is a “good” instrument since it is correlated with (yi,t−1 − yi,t−2)

17

Page 18: Part I Ch 1. Linear Non Dynamic Panel Data Models · 2012. 10. 16. · 4.2 Linear Panel Data Estimates • The parameter λ is defined in the estimators section as λ =1− σ σ2

Arellano–Bond Estimator

βAB =

��N�

i=1

X�

iZi

�WN

�N�

i=1

Z�

iXi

��−1 � N�

i=1

X�

iZi

�WN

�N�

i=1

Z�

iyi

�(19)

• where

– Xi is a (T − 2)× (K + 1) matrix with tth row�∆yi,t−1,∆x

it

�, T = 3, . . . , T

– yi is a (T − 2)× 1 vector with tthrow ∆yit

– Zi is a (T − 2)× r matrix of instruments :

Zi =

z�

i3 0 · · · 0

0 z�

i4

......

. . . 00 · · · 0 z

iT

(20)

where often z�it =�yi,t−2, yi,t−3, . . . , yi1,∆x

it

Example

• Arellano-Bond data set available in Gretl econometrics software abdata.dta

• Year = t, n = log of employment, w = log of real wage, k = log of gross capital, ys = log ofindustry output, unit = firm index (i)

• Panel structure : xtset unit year, yearly

• Arellano-Bond estimator (default options) : xtabond n w k ys, lags(1) vce(robust) artests(2)

18

Page 19: Part I Ch 1. Linear Non Dynamic Panel Data Models · 2012. 10. 16. · 4.2 Linear Panel Data Estimates • The parameter λ is defined in the estimators section as λ =1− σ σ2

Part III

Ch 3. Binary Choice Panel Data Models1 Introduction

• Underlying latent model (usual notation)

y∗it = x�

itβ + αi + �it (1)

• y∗ is not observed

– yit=1 if y∗it > x�

itβ + αi + �it

– else yit = 0

• LogLikelihood fct lnL (β,α1, ...,αN ) =

i,t

yit lnF�αi + x

itβ�+

i,t

(1− yit) ln�1− F

�αi + x

it�

2 RE Model

• The (conditionnal) probability of observing a certain outcome for i (over all periods t) is

f (yi1, ..., yiT |xi1, ..., xiT ,β,αi)

• We start with the conditional density h�|α (�it|αi)

– If we multiply by the marginal hα (αi), we obtain by Bayes’rule the joint density h�α (�it,αi) =h�|α (�it|αi)hα (αi)

– Then integrate the joint on αi, we obtain the marginal on �it :�h�α (�it,αi) dα = h� (�it)

– That shows that we can estimate the β by integrating out the αi

• The resulting likelihood is called the Conditional Maximum Likelihood f (yi1, ..., yiT |xi1, ..., xiT ,β)

=

� +∞

−∞f (yi1, ..., yiT |xi1, ..., xiT ,β,αi) g (αi) dαi

=

� +∞

−∞[Πtf (yit|xit,β,αi)] g (αi) dαi

• So, in practice, we write the log-likelihood function of the binary choice model�

i

lnf (yi1, ..., yiT |xi1, ..., xiT ,β)

as

i

t

� +∞

−∞ln f (yit|xit,β,αi) g (αi) dαi

19

Page 20: Part I Ch 1. Linear Non Dynamic Panel Data Models · 2012. 10. 16. · 4.2 Linear Panel Data Estimates • The parameter λ is defined in the estimators section as λ =1− σ σ2

3 FE Model

• For the logit model, it is possible to show that the (conditionnal) probability of observing acertain outcome for i (over all periods t) is

f (yi1, ..., yiT |xi1, ..., xiT ,β,αi) =exp (αi

�t yit) exp

���y yitx

it

�β�

Πt

�1 + exp

�αi + x

�itβ

��

• If�

t yit = 0 or = T , then

f (yi1, ..., yiT |xi1, ..., xiT ,β,αi) =1

Πt[1+exp(αi+x�itβ)]

or =Πt exp

�αi+x

�itβ

Πt[1+exp(αi+x�itβ)]

respectively

Changing Behavior : Take T = 2 and�

t yit = 1

• Then only the sequences {0, 1} or {1, 0} are possible :

Pr

�(0, 1) |

t

yit = 1,αi,β

�=

Pr {(0, 1) |αi,β}Pr {(0, 1) |αi,β}+ Pr {(1, 0) |αi,β}

• Pr {(0, 1) |αi,β} = Pr {yi1 = 0|αi,β}Pr {yi2 = 1|αi,β}

• With the logistic :

– Pr {yit = 1|αi,β} =exp (αi + xitβ)

1 + exp (αi + xitβ)

– Pr {yit = 0|αi,β} =1

1 + exp (αi + xitβ)

• So, Pr {(0, 1) |αi,β} =1

1 + exp (αi + xi1β)

exp (αi + xi2β)

1 + exp (αi + xi2β)

• And

Pr

�(0, 1) |

t

yit = 1,αi,β

�=

exp (αi + xi2β)

exp (αi + xi2β) + exp (αi + xi1β)

=exp (xi2β)

exp (xi2β) + exp (xi1β)

=exp ((xi2 − xi1)β)

1 + exp ((xi2 − xi1)β)

Example : Unionization of Women in the US

• Setup webuse union

20

Page 21: Part I Ch 1. Linear Non Dynamic Panel Data Models · 2012. 10. 16. · 4.2 Linear Panel Data Estimates • The parameter λ is defined in the estimators section as λ =1− σ σ2

• Random-effects logit model (default logit)

– xtlogit union age grade not_smsa south##c.year

• Fixed-effects logit model

– xtlogit union age grade not_smsa south##c.year, fe

21