Lecture 12 Panel Data · Acemoglu et al. (2008, 2015) Panel data in Stata Lecture 12 – Panel Data...

59
Introduction Random/FE/GLS IV Lagged Y Binary outcome models Application. Acemoglu et al. (2008, 2015) P Lecture 12 – Panel Data Economics 8379 George Washington University Instructor: Prof. Ben Williams

Transcript of Lecture 12 Panel Data · Acemoglu et al. (2008, 2015) Panel data in Stata Lecture 12 – Panel Data...

Page 1: Lecture 12 Panel Data · Acemoglu et al. (2008, 2015) Panel data in Stata Lecture 12 – Panel Data Economics 8379 ... Panel IV can be a solution to the measurement error

Introduction Random/FE/GLS IV Lagged Y Binary outcome models Application. Acemoglu et al. (2008, 2015) Panel data in Stata

Lecture 12 – Panel Data

Economics 8379George Washington University

Instructor: Prof. Ben Williams

Page 2: Lecture 12 Panel Data · Acemoglu et al. (2008, 2015) Panel data in Stata Lecture 12 – Panel Data Economics 8379 ... Panel IV can be a solution to the measurement error

Introduction Random/FE/GLS IV Lagged Y Binary outcome models Application. Acemoglu et al. (2008, 2015) Panel data in Stata

Introduction

• This lecture will discuss some common panel datamethods and problems.• Random effects vs. fixed vs. alternatives• IV in panel data• Lagged dependent variables• Binary Outcome panel data models

Page 3: Lecture 12 Panel Data · Acemoglu et al. (2008, 2015) Panel data in Stata Lecture 12 – Panel Data Economics 8379 ... Panel IV can be a solution to the measurement error

Introduction Random/FE/GLS IV Lagged Y Binary outcome models Application. Acemoglu et al. (2008, 2015) Panel data in Stata

The linear panel model

• Basic model and assumptions:

yit = β′xit + ηi + νit

A1 E(νi1, . . . , νiT | xi1, . . . , xiT , ηi ) = 0A2 Var(νi1, . . . , νiT | xi1, . . . , xiT , ηi ) = σ2IT

• These assumptions can be replaced by weaker but harderto interpret assumptions.

Page 4: Lecture 12 Panel Data · Acemoglu et al. (2008, 2015) Panel data in Stata Lecture 12 – Panel Data Economics 8379 ... Panel IV can be a solution to the measurement error

Introduction Random/FE/GLS IV Lagged Y Binary outcome models Application. Acemoglu et al. (2008, 2015) Panel data in Stata

Differencing and within variation

• Some notation first:• yi = (yi1, . . . , yiT )′

• xi = (xi1, . . . , xiT )′

• νi = (νi1, . . . , νiT )′

• The basic idea you’ve seen before:

∆yit = β′∆xit + ∆νit

and E(∆νit | ∆xit ) = 0

• In matrix notation,

Dyi = Dxiβ + Dνi

where D is the (T − 1)× T first difference operator.

Page 5: Lecture 12 Panel Data · Acemoglu et al. (2008, 2015) Panel data in Stata Lecture 12 – Panel Data Economics 8379 ... Panel IV can be a solution to the measurement error

Introduction Random/FE/GLS IV Lagged Y Binary outcome models Application. Acemoglu et al. (2008, 2015) Panel data in Stata

Differencing and within variation

• The fixed effects regression is not(∑n

i=1 x ′i D′Dxi)

−1∑ni=1 x ′i D

′Dyi , though this firstdifferences estimator would be consistent underassumption A1.

• Because Var(Dνi | xi) = σ2DD′, the GLS estimator is moreefficient,

βfe := (n∑

i=1

x ′i D′(DD′)−1Dxi)

−1n∑

i=1

x ′i D′(DD′)−1Dyi

Page 6: Lecture 12 Panel Data · Acemoglu et al. (2008, 2015) Panel data in Stata Lecture 12 – Panel Data Economics 8379 ... Panel IV can be a solution to the measurement error

Introduction Random/FE/GLS IV Lagged Y Binary outcome models Application. Acemoglu et al. (2008, 2015) Panel data in Stata

Differencing and within variation

• The fixed effects regression is not(∑n

i=1 x ′i D′Dxi)

−1∑ni=1 x ′i D

′Dyi , though this firstdifferences estimator would be consistent underassumption A1.

• Because Var(Dνi | xi) = σ2DD′, the GLS estimator is moreefficient,

βfe := (n∑

i=1

x ′i D′(DD′)−1Dxi)

−1n∑

i=1

x ′i D′(DD′)−1Dyi

Page 7: Lecture 12 Panel Data · Acemoglu et al. (2008, 2015) Panel data in Stata Lecture 12 – Panel Data Economics 8379 ... Panel IV can be a solution to the measurement error

Introduction Random/FE/GLS IV Lagged Y Binary outcome models Application. Acemoglu et al. (2008, 2015) Panel data in Stata

Differencing and within variation

• But Q = D′(DD′)−1D is idempotent and equal to IT − ιι′/T .This is the within-group operator.• The fixed effects estimator is based on within variation.• The fixed effects estimator is equivalent to including entity

dummies.

Page 8: Lecture 12 Panel Data · Acemoglu et al. (2008, 2015) Panel data in Stata Lecture 12 – Panel Data Economics 8379 ... Panel IV can be a solution to the measurement error

Introduction Random/FE/GLS IV Lagged Y Binary outcome models Application. Acemoglu et al. (2008, 2015) Panel data in Stata

Differencing and within variation

• Properties of the fixed effects (or within-group) estimator:• For a fixed T , βfe is unbiased and optimal1, and as n→∞ it

is consistent and asymptotically normal.• Estimates of ηi are unbiased but only consistent if T →∞.• If T →∞ then βfe is consistent, even if n is fixed.

Page 9: Lecture 12 Panel Data · Acemoglu et al. (2008, 2015) Panel data in Stata Lecture 12 – Panel Data Economics 8379 ... Panel IV can be a solution to the measurement error

Introduction Random/FE/GLS IV Lagged Y Binary outcome models Application. Acemoglu et al. (2008, 2015) Panel data in Stata

Differencing and within variation

• Robust standard errors:• If A2 does not hold then the usual standard error formula for

OLS on the transformed data is inconsistent.• If T is fixed and n is large then the clustered (on entity)

standard error formula provides a HAC estimator.• If T is large and n is fixed then a Newey West type std error

estimator is required for consistency under serialcorrelation.

Page 10: Lecture 12 Panel Data · Acemoglu et al. (2008, 2015) Panel data in Stata Lecture 12 – Panel Data Economics 8379 ... Panel IV can be a solution to the measurement error

Introduction Random/FE/GLS IV Lagged Y Binary outcome models Application. Acemoglu et al. (2008, 2015) Panel data in Stata

Differencing and within variation

• Under serial correlation in νit , the fixed effects estimator isnot optimal. Let ν∗i = Dνi .• Generally, if Var(ν∗i | xi ) = Ω(xi ) then the GLS estimator is

(n∑

i=1

x ′i D′Ω(xi )Dxi

)−1 n∑

i=1

x ′i D′Ω(xi )Dyi

• In the special case where Var(ν∗i | xi ) = Ω, replace Ω(xi )with

Ω = n−1n∑

i=1

ν∗i ν∗′i

to get a feasible GLS estimator.

Page 11: Lecture 12 Panel Data · Acemoglu et al. (2008, 2015) Panel data in Stata Lecture 12 – Panel Data Economics 8379 ... Panel IV can be a solution to the measurement error

Introduction Random/FE/GLS IV Lagged Y Binary outcome models Application. Acemoglu et al. (2008, 2015) Panel data in Stata

Random effects

• Pooled OLS estimator is

βpooled =

(n∑

i=1

x ′i xi

)n∑

i=1

x ′i yi

• It’s unbiased and consistent only under the assumptionthat E(ηixit ) = 0.

• Under assumption A2 and Var(ηi | xi) = σ2η ,

Var(ηi ι+ νi | xi) = σ2ηιι′ + σ2IT

Page 12: Lecture 12 Panel Data · Acemoglu et al. (2008, 2015) Panel data in Stata Lecture 12 – Panel Data Economics 8379 ... Panel IV can be a solution to the measurement error

Introduction Random/FE/GLS IV Lagged Y Binary outcome models Application. Acemoglu et al. (2008, 2015) Panel data in Stata

Random effects

• The GLS estimator is then

βGLS =

(n∑

i=1

xiV−1x ′i

)n∑

i=1

xiV−1yi

where V−1 = σ−2 (IT − σ2ηιι′/(σ2 + Tσ2

η)).

• This is the random effects estimator.• When T →∞, this becomes the fixed effects estimator.• More generally, if ψ = σ2

η/(σ2 + Tσ2η) goes to 0 we get fixed

effects and if ψ goes to 1 we get pooled OLS.

Page 13: Lecture 12 Panel Data · Acemoglu et al. (2008, 2015) Panel data in Stata Lecture 12 – Panel Data Economics 8379 ... Panel IV can be a solution to the measurement error

Introduction Random/FE/GLS IV Lagged Y Binary outcome models Application. Acemoglu et al. (2008, 2015) Panel data in Stata

Random effects

• Feasible GLS• Estimate ψ in first stage to get estimate of V .• Several ways to estimate ψ.• This is what xtreg ...,re in Stata does.

• An alternative is the maximum likelihood estimator that willestimate β and σ and σ2

η simultaneously.• the usual MLE assumes that ηi ∼ N(0, σ2

η) though differentdistributions can be used.

Page 14: Lecture 12 Panel Data · Acemoglu et al. (2008, 2015) Panel data in Stata Lecture 12 – Panel Data Economics 8379 ... Panel IV can be a solution to the measurement error

Introduction Random/FE/GLS IV Lagged Y Binary outcome models Application. Acemoglu et al. (2008, 2015) Panel data in Stata

Random effects vs fixed effects

• The primary difference between the two is that randomeffects assumes ηi is uncorrelated with xit .

• The idea of fixed (non-random) versus random effects isnot the real distinction.

• Mundlak (1978) showed that the fixed effects estimator isequivalent to a random effects type (GLS) estimator of themodel where ηi = a′xi + ωi where ωi is independent of xi .• Not true in nonlinear models!

Page 15: Lecture 12 Panel Data · Acemoglu et al. (2008, 2015) Panel data in Stata Lecture 12 – Panel Data Economics 8379 ... Panel IV can be a solution to the measurement error

Introduction Random/FE/GLS IV Lagged Y Binary outcome models Application. Acemoglu et al. (2008, 2015) Panel data in Stata

Measurement error

• Motivating example – Bover and Watson (2000)• consider a simplified version of the model from Arellano

(2003)• Conditional money demand equation:

• yit denotes cash holdings (real money balances) of firm i inyear t

• xit denotes sales• ηi = −log(ai ) where ai denotes a firm’s “financial

sophistication”

Page 16: Lecture 12 Panel Data · Acemoglu et al. (2008, 2015) Panel data in Stata Lecture 12 – Panel Data Economics 8379 ... Panel IV can be a solution to the measurement error

Introduction Random/FE/GLS IV Lagged Y Binary outcome models Application. Acemoglu et al. (2008, 2015) Panel data in Stata

Measurement error

• Suppose xit = xit + εit and the true regressor values, xit areunobserved.

• Fixed effects can exacerbate measurement error bias:

• The measurement error bias in the FE estimator whenT = 2 is β

(1− 1

1+λ

)where

λ = Var(∆εit )/Var(∆xit )

• If εit and xit are both iid then this attentuation bias is identicalto the cross-sectional bias.

• If εit is iid but xit is positively serially correlated then the biasis larger than in the cross-section.

Page 17: Lecture 12 Panel Data · Acemoglu et al. (2008, 2015) Panel data in Stata Lecture 12 – Panel Data Economics 8379 ... Panel IV can be a solution to the measurement error

Introduction Random/FE/GLS IV Lagged Y Binary outcome models Application. Acemoglu et al. (2008, 2015) Panel data in Stata

Measurement error

• Suppose xit = xit + εit and the true regressor values, xit areunobserved.

• Fixed effects can exacerbate measurement error bias:• The measurement error bias in the FE estimator when

T = 2 is β(

1− 11+λ

)where

λ = Var(∆εit )/Var(∆xit )

• If εit and xit are both iid then this attentuation bias is identicalto the cross-sectional bias.

• If εit is iid but xit is positively serially correlated then the biasis larger than in the cross-section.

Page 18: Lecture 12 Panel Data · Acemoglu et al. (2008, 2015) Panel data in Stata Lecture 12 – Panel Data Economics 8379 ... Panel IV can be a solution to the measurement error

Introduction Random/FE/GLS IV Lagged Y Binary outcome models Application. Acemoglu et al. (2008, 2015) Panel data in Stata

Measurement error

• When T > 2, εit is iid and xit is positively serially correlated– Griliches and Hausman (1986) show that the bias of thefixed effects estimator lies between the bias of pooled OLSand that of OLS in first-differences.

• Panel IV can be a solution to the measurement errorproblem when εit is not serially correlated and xit is.• If ηi is independent (random effects/pooled OLS model)

thenE(xis(yit − β′xit )) = 0

for s 6= t

Page 19: Lecture 12 Panel Data · Acemoglu et al. (2008, 2015) Panel data in Stata Lecture 12 – Panel Data Economics 8379 ... Panel IV can be a solution to the measurement error

Introduction Random/FE/GLS IV Lagged Y Binary outcome models Application. Acemoglu et al. (2008, 2015) Panel data in Stata

Measurement error

• When T > 2, εit is iid and xit is positively serially correlated– Griliches and Hausman (1986) show that the bias of thefixed effects estimator lies between the bias of pooled OLSand that of OLS in first-differences.

• Panel IV can be a solution to the measurement errorproblem when εit is not serially correlated and xit is.• If ηi is independent (random effects/pooled OLS model)

thenE(xis(yit − β′xit )) = 0

for s 6= t

Page 20: Lecture 12 Panel Data · Acemoglu et al. (2008, 2015) Panel data in Stata Lecture 12 – Panel Data Economics 8379 ... Panel IV can be a solution to the measurement error

Introduction Random/FE/GLS IV Lagged Y Binary outcome models Application. Acemoglu et al. (2008, 2015) Panel data in Stata

Measurement error

• If ηi is correlated with xit , one solution is to take firstdifferences and use the moment conditions

E(xis(∆yit − β′∆xit )) = 0

for s = 1, . . . , t − 2, t + 1, . . . ,T• This requires T ≥ 3.• Also, the rank condition should be considered carefully.

What if xit is white noise? What is xit is a random walk?What if xit = αi + ξit?

• With larger T , there is a tradeoff between allowing serialcorrelation in εit and needing serial correlation in xit .

Page 21: Lecture 12 Panel Data · Acemoglu et al. (2008, 2015) Panel data in Stata Lecture 12 – Panel Data Economics 8379 ... Panel IV can be a solution to the measurement error

Introduction Random/FE/GLS IV Lagged Y Binary outcome models Application. Acemoglu et al. (2008, 2015) Panel data in Stata

Measurement error• Table from Bover and Watson (2000):

Page 22: Lecture 12 Panel Data · Acemoglu et al. (2008, 2015) Panel data in Stata Lecture 12 – Panel Data Economics 8379 ... Panel IV can be a solution to the measurement error

Introduction Random/FE/GLS IV Lagged Y Binary outcome models Application. Acemoglu et al. (2008, 2015) Panel data in Stata

Measurement error

• The relationship among the pooled OLS, FE, and firstdifference estimators is consistent with measurement errorin sales.

• Column (4) is GMM on first differences using other timeperiods as instruments.• The Sargan test here is also marginally suggestive of

measurement error.

• Columns (5) and (6) seem to correct for measurementerror and are consistent with the expectation that pooledOLS should be downward biased.

Page 23: Lecture 12 Panel Data · Acemoglu et al. (2008, 2015) Panel data in Stata Lecture 12 – Panel Data Economics 8379 ... Panel IV can be a solution to the measurement error

Introduction Random/FE/GLS IV Lagged Y Binary outcome models Application. Acemoglu et al. (2008, 2015) Panel data in Stata

Panel IV

• Start with the RE/pooled model where yit = β′xit + uit .• Moment conditions: E(z ′i ui) = 0 where zi is a T × r matrix

of instruments.• Given r × r weighting matrix WN , the panel GMM estimator

is

βPGMM =

((

n∑

i=1

x ′i zi)WN(n∑

i=1

z ′i xi)

)−1

(n∑

i=1

x ′i zi)WN(n∑

i=1

z ′i yi)

Page 24: Lecture 12 Panel Data · Acemoglu et al. (2008, 2015) Panel data in Stata Lecture 12 – Panel Data Economics 8379 ... Panel IV can be a solution to the measurement error

Introduction Random/FE/GLS IV Lagged Y Binary outcome models Application. Acemoglu et al. (2008, 2015) Panel data in Stata

Panel IV

• The weighting matrix doesn’t matter if r = dim(β) so thatthe model is just identified.

• The one step GMM estimator (which is just 2SLS) usesWN = (

∑ni=1 z ′i zi)

−1

• As we’ve seen, this is optimal under homoskedasticity.

• The two step GMM estimator calculates a robust estimateof the asymptotic variance of n−1∑n

i=1 z ′i ui . This is S andthen WN = S−1.

Page 25: Lecture 12 Panel Data · Acemoglu et al. (2008, 2015) Panel data in Stata Lecture 12 – Panel Data Economics 8379 ... Panel IV can be a solution to the measurement error

Introduction Random/FE/GLS IV Lagged Y Binary outcome models Application. Acemoglu et al. (2008, 2015) Panel data in Stata

Panel IV

• Moment conditions.• Pooled OLS is equivalent to taking zi = xi . Note that the

moment conditions are then of the form:

E(T∑

t=1

xituit ) = 0

• The moment conditions E(zituit ) = 0 can be enforced bydefining Zi as the Tdim(zit )× T block diagonal matrix withz ′i1, . . . , z

′iT on the diagonal.

• You get even more moment conditions under weakexogeneity (T (T − 1)r ) or strong exogeneity (T 2r ).• Careful of the weak/many instruments finite sample bias!

Page 26: Lecture 12 Panel Data · Acemoglu et al. (2008, 2015) Panel data in Stata Lecture 12 – Panel Data Economics 8379 ... Panel IV can be a solution to the measurement error

Introduction Random/FE/GLS IV Lagged Y Binary outcome models Application. Acemoglu et al. (2008, 2015) Panel data in Stata

Panel IV

• Moment conditions.• Pooled OLS is equivalent to taking zi = xi . Note that the

moment conditions are then of the form:

E(T∑

t=1

xituit ) = 0

• The moment conditions E(zituit ) = 0 can be enforced bydefining Zi as the Tdim(zit )× T block diagonal matrix withz ′i1, . . . , z

′iT on the diagonal.

• You get even more moment conditions under weakexogeneity (T (T − 1)r ) or strong exogeneity (T 2r ).• Careful of the weak/many instruments finite sample bias!

Page 27: Lecture 12 Panel Data · Acemoglu et al. (2008, 2015) Panel data in Stata Lecture 12 – Panel Data Economics 8379 ... Panel IV can be a solution to the measurement error

Introduction Random/FE/GLS IV Lagged Y Binary outcome models Application. Acemoglu et al. (2008, 2015) Panel data in Stata

Panel IV

• Moment conditions.• Pooled OLS is equivalent to taking zi = xi . Note that the

moment conditions are then of the form:

E(T∑

t=1

xituit ) = 0

• The moment conditions E(zituit ) = 0 can be enforced bydefining Zi as the Tdim(zit )× T block diagonal matrix withz ′i1, . . . , z

′iT on the diagonal.

• You get even more moment conditions under weakexogeneity (T (T − 1)r ) or strong exogeneity (T 2r ).• Careful of the weak/many instruments finite sample bias!

Page 28: Lecture 12 Panel Data · Acemoglu et al. (2008, 2015) Panel data in Stata Lecture 12 – Panel Data Economics 8379 ... Panel IV can be a solution to the measurement error

Introduction Random/FE/GLS IV Lagged Y Binary outcome models Application. Acemoglu et al. (2008, 2015) Panel data in Stata

Panel IV with fixed effects

• Suppose uit = ηi + νit .• The GMM estimators take the same form as before except

applied to y†it = β′x†it + ν†it where y†it , x†it , and ν†it representsome differencing transformation.

• The available moment conditions depend on what type ofdifferencing is used.

• Random vs. fixed• The relevant distinction now is whether we want to assume

that E(Z ′i ui ) = 0 or E(Z ′i ν†i ) = 0; the former requires any

fixed effect ηi to be uncorrelated with Zi , though notnecessarily with Xi .

• Under the random effects assumption it is again possible totake advantage of the error component structure to improveefficiency.

Page 29: Lecture 12 Panel Data · Acemoglu et al. (2008, 2015) Panel data in Stata Lecture 12 – Panel Data Economics 8379 ... Panel IV can be a solution to the measurement error

Introduction Random/FE/GLS IV Lagged Y Binary outcome models Application. Acemoglu et al. (2008, 2015) Panel data in Stata

Panel IV with fixed effects

• Suppose uit = ηi + νit .• The GMM estimators take the same form as before except

applied to y†it = β′x†it + ν†it where y†it , x†it , and ν†it representsome differencing transformation.

• The available moment conditions depend on what type ofdifferencing is used.

• Random vs. fixed• The relevant distinction now is whether we want to assume

that E(Z ′i ui ) = 0 or E(Z ′i ν†i ) = 0; the former requires any

fixed effect ηi to be uncorrelated with Zi , though notnecessarily with Xi .

• Under the random effects assumption it is again possible totake advantage of the error component structure to improveefficiency.

Page 30: Lecture 12 Panel Data · Acemoglu et al. (2008, 2015) Panel data in Stata Lecture 12 – Panel Data Economics 8379 ... Panel IV can be a solution to the measurement error

Introduction Random/FE/GLS IV Lagged Y Binary outcome models Application. Acemoglu et al. (2008, 2015) Panel data in Stata

Panel IV with fixed effects

• Suppose uit = ηi + νit .• The GMM estimators take the same form as before except

applied to y†it = β′x†it + ν†it where y†it , x†it , and ν†it representsome differencing transformation.

• The available moment conditions depend on what type ofdifferencing is used.

• Random vs. fixed• The relevant distinction now is whether we want to assume

that E(Z ′i ui ) = 0 or E(Z ′i ν†i ) = 0; the former requires any

fixed effect ηi to be uncorrelated with Zi , though notnecessarily with Xi .

• Under the random effects assumption it is again possible totake advantage of the error component structure to improveefficiency.

Page 31: Lecture 12 Panel Data · Acemoglu et al. (2008, 2015) Panel data in Stata Lecture 12 – Panel Data Economics 8379 ... Panel IV can be a solution to the measurement error

Introduction Random/FE/GLS IV Lagged Y Binary outcome models Application. Acemoglu et al. (2008, 2015) Panel data in Stata

Strong vs weak exogeneity

• Assumption A1 for the fixed effects estimator was thatE(νit | xi , ηi) = 0

• This is strong exogeneity.• This implies no feedback – xit cannot be informed by νis for

s < t• so it rules out lagged dependent variables – xit = yi(t−1)

• We will focus on the lagged dependent variable problemand consider two basic solutions:• figure out which past values can be used as instruments• fixed effects is ok for large T

Page 32: Lecture 12 Panel Data · Acemoglu et al. (2008, 2015) Panel data in Stata Lecture 12 – Panel Data Economics 8379 ... Panel IV can be a solution to the measurement error

Introduction Random/FE/GLS IV Lagged Y Binary outcome models Application. Acemoglu et al. (2008, 2015) Panel data in Stata

AR model without fixed effects

• Consider as a simple example the autoregressive model:yit = αyi(t−1) + βxit + νit

• What happens if we do fixed effects?• With T = 2,

yi2 − yi1 = (α− 1)yi1 + β(xi2 − xi1) + βxi1 + νi2

• Regressing yi2 − yi1 on xi2 − xi1 produces a bias thatdepends on the sign of α− 1, of Cov(yi1, xi2 − xi1), of β andof Cov(xi1, xi2 − xi1).

• In some cases, the effect estimate from the AR modelwithout fixed effects and the fixed effects estimate (withoutlagged yit ) bound the true parameter but this is not alwaystrue.

Page 33: Lecture 12 Panel Data · Acemoglu et al. (2008, 2015) Panel data in Stata Lecture 12 – Panel Data Economics 8379 ... Panel IV can be a solution to the measurement error

Introduction Random/FE/GLS IV Lagged Y Binary outcome models Application. Acemoglu et al. (2008, 2015) Panel data in Stata

AR model without fixed effects

• Consider as a simple example the autoregressive model:yit = αyi(t−1) + βxit + νit

• What happens if we do fixed effects?• With T = 2,

yi2 − yi1 = (α− 1)yi1 + β(xi2 − xi1) + βxi1 + νi2

• Regressing yi2 − yi1 on xi2 − xi1 produces a bias thatdepends on the sign of α− 1, of Cov(yi1, xi2 − xi1), of β andof Cov(xi1, xi2 − xi1).

• In some cases, the effect estimate from the AR modelwithout fixed effects and the fixed effects estimate (withoutlagged yit ) bound the true parameter but this is not alwaystrue.

Page 34: Lecture 12 Panel Data · Acemoglu et al. (2008, 2015) Panel data in Stata Lecture 12 – Panel Data Economics 8379 ... Panel IV can be a solution to the measurement error

Introduction Random/FE/GLS IV Lagged Y Binary outcome models Application. Acemoglu et al. (2008, 2015) Panel data in Stata

AR model with fixed effects

• Consider as a simple example the autoregressive model:yit = αyi(t−1) + ηi + νit

B1 E(νit | y t−1i , ηi ) = 0

B2 E(ν2it | y t−1

i , ηi ) = σ2

B3 (mean stationarity) E(yi0 | ηi ) = ηi/(1− α)B4 (covariance stationarity) Var(yi0 | ηi ) = σ2/(1− α2)

• The fixed effects estimator has a bias that is• equal to −(1 + α)/2 when T = 2• approximately −(1 + α)/T for large T

• This is called the Nickell bias due to pioneering work ofNickell (1981).

Page 35: Lecture 12 Panel Data · Acemoglu et al. (2008, 2015) Panel data in Stata Lecture 12 – Panel Data Economics 8379 ... Panel IV can be a solution to the measurement error

Introduction Random/FE/GLS IV Lagged Y Binary outcome models Application. Acemoglu et al. (2008, 2015) Panel data in Stata

AR model with fixed effects

• Without assumptions B3 and B4 the bias is morecomplicated.• E.g., if T = 2 and σ2

η/Var(νi1) is large then the bias is verysmall.

• What if T is large but the same order of magnitude as n?• Formally, if n/T → c > 0 then

√nT (αfe − α) ≈ N(−c(1 + α), (1− α2)/(nT ))

• For moderate values of T , a bias-corrected estimator:

αfe,bc = αfe +1 + αfe

T

Page 36: Lecture 12 Panel Data · Acemoglu et al. (2008, 2015) Panel data in Stata Lecture 12 – Panel Data Economics 8379 ... Panel IV can be a solution to the measurement error

Introduction Random/FE/GLS IV Lagged Y Binary outcome models Application. Acemoglu et al. (2008, 2015) Panel data in Stata

IV solution

• Anderson and Hsiao (1981, 1982) suggested using an IVestimator that uses yi(t−2) or ∆yi(t−2) as an instrument for∆yit when T ≥ 3 or T ≥ 4.

• There are potentially many more moment conditions underassumption B1:

E(y t−1i (∆yit − α∆yi(t−1))) = 0, t = 2, . . . ,T

Page 37: Lecture 12 Panel Data · Acemoglu et al. (2008, 2015) Panel data in Stata Lecture 12 – Panel Data Economics 8379 ... Panel IV can be a solution to the measurement error

Introduction Random/FE/GLS IV Lagged Y Binary outcome models Application. Acemoglu et al. (2008, 2015) Panel data in Stata

IV solution

• Anderson and Hsiao (1981, 1982) suggested using an IVestimator that uses yi(t−2) or ∆yi(t−2) as an instrument for∆yit when T ≥ 3 or T ≥ 4.

• There are potentially many more moment conditions underassumption B1:

E(y t−1i (∆yit − α∆yi(t−1))) = 0, t = 2, . . . ,T

Page 38: Lecture 12 Panel Data · Acemoglu et al. (2008, 2015) Panel data in Stata Lecture 12 – Panel Data Economics 8379 ... Panel IV can be a solution to the measurement error

Introduction Random/FE/GLS IV Lagged Y Binary outcome models Application. Acemoglu et al. (2008, 2015) Panel data in Stata

IV solution

• Holtz-Eakin, Newey, and Rosen (1988) and Arellano andBond (1991) suggest implementing a GMM estimator thatuses all (T − 1)T/2 moment conditions.

• The Arellano Bond estimator uses a one-step optimalweighting matrix that accounts for serial correlation due todifferencing,

V =n∑

i=1

z ′i DD′zi

• There is a bias however when n ≈ T that is proportional to1/n.

Page 39: Lecture 12 Panel Data · Acemoglu et al. (2008, 2015) Panel data in Stata Lecture 12 – Panel Data Economics 8379 ... Panel IV can be a solution to the measurement error

Introduction Random/FE/GLS IV Lagged Y Binary outcome models Application. Acemoglu et al. (2008, 2015) Panel data in Stata

IV solution

• Advice:

• When T is larger than n, use FE.

• When n is larger than T , use Arellano-Bond.

• When n is similar in magnitude to T , use bias-correction orlimited number of instruments/moments.

Page 40: Lecture 12 Panel Data · Acemoglu et al. (2008, 2015) Panel data in Stata Lecture 12 – Panel Data Economics 8379 ... Panel IV can be a solution to the measurement error

Introduction Random/FE/GLS IV Lagged Y Binary outcome models Application. Acemoglu et al. (2008, 2015) Panel data in Stata

With lagged dependent variables and other regressors

• Suppose yit = αyi(t−1) + β′xit + ηi + νit .• Use additional lags of xit as instruments for ∆yi(t−1) – this

helps when νit is serially correlated.• tradeoff between exogeneity assumptions on xit and serial

correlation in νit , especially for small T• Again, fixed effects will be consistent, and sometimes

preferred, for large T

Page 41: Lecture 12 Panel Data · Acemoglu et al. (2008, 2015) Panel data in Stata Lecture 12 – Panel Data Economics 8379 ... Panel IV can be a solution to the measurement error

Introduction Random/FE/GLS IV Lagged Y Binary outcome models Application. Acemoglu et al. (2008, 2015) Panel data in Stata

Extensions

• Arellano and Bover (1995) and Blundell and Bond (1998)suggest also using differences to instrument for levels.

• Use additional moments for time invariant regressors.(Hausman and Taylor, 1981)

• Using covariance structure to improve efficiency.

Page 42: Lecture 12 Panel Data · Acemoglu et al. (2008, 2015) Panel data in Stata Lecture 12 – Panel Data Economics 8379 ... Panel IV can be a solution to the measurement error

Introduction Random/FE/GLS IV Lagged Y Binary outcome models Application. Acemoglu et al. (2008, 2015) Panel data in Stata

Static binary choice panel model

• Static model:

Pr(yi | xi , ηi) =T∏

t=1

F (β′xit + ηi)

• The log likelihood function is

`(β, ηi) =n∑

i=1

T∑

t=1

log(F (β′xit + ηi ))

• The log of the integrated likelihood function is

¯(β) =n∑

i=1

log

(∫ T∏

t=1

F (β′xit + ηi )fη|x (ηi | xi )dηi

)

Page 43: Lecture 12 Panel Data · Acemoglu et al. (2008, 2015) Panel data in Stata Lecture 12 – Panel Data Economics 8379 ... Panel IV can be a solution to the measurement error

Introduction Random/FE/GLS IV Lagged Y Binary outcome models Application. Acemoglu et al. (2008, 2015) Panel data in Stata

Static model

• Random effects models are based on the integratedlikelihood.• Random effects probit/logit assume that fη|x = fη.

• Similar assumption to RE in linear models.• Similarly, this is more efficient than a pooled probit/logit

estimator but potentially more efficient by accounting forcross-equation dependence.

• The Mundlak/Chamberlain approach: ηi = a′xi + ωi , or ηi issome other function of xi .• This is implemented using the integrated likelihood with

fη|x (ηi | xi ) = fω(ηi − a′xi )• This reduces to

∫ T∏

t=1

F (β′xit + a′xi + ωi )fω(ωi )dωi

• Cannot identify βk if xitk is time invariant.

Page 44: Lecture 12 Panel Data · Acemoglu et al. (2008, 2015) Panel data in Stata Lecture 12 – Panel Data Economics 8379 ... Panel IV can be a solution to the measurement error

Introduction Random/FE/GLS IV Lagged Y Binary outcome models Application. Acemoglu et al. (2008, 2015) Panel data in Stata

Static model

• Fixed effects models are based on the full likelihood,`(β, ηi)• Treat the ηi as separate parameters.• This introduces the incidental parameter problem (Neyman

and Scott, 1948).• The fixed effects estimator is biased for a fixed T , but is

consistent as T →∞.• If T and n are of similar magnitude, or T is smaller, then FE

doesn’t work.• When T and n are of similar magnitude bias corrections

have been suggested (see work of Fernandez-Val andothers)

Page 45: Lecture 12 Panel Data · Acemoglu et al. (2008, 2015) Panel data in Stata Lecture 12 – Panel Data Economics 8379 ... Panel IV can be a solution to the measurement error

Introduction Random/FE/GLS IV Lagged Y Binary outcome models Application. Acemoglu et al. (2008, 2015) Panel data in Stata

Static model

• Conditional logit:• In the logit model, when T = 2,

Pr(yi1 = 0, yi2 = 1 | yi1+yi2 = 1, xi ) =exp(x ′i1β)

exp(x ′i1β) + exp(x ′i2β)

• This conditional likelihood estimator is implemented inStata via clogit

• Not logit with i.caseid!!• For larger T , condition on

∑Tt=1 yit .

• This approach works for dynamic logit and multinomial logitmodels as well.

Page 46: Lecture 12 Panel Data · Acemoglu et al. (2008, 2015) Panel data in Stata Lecture 12 – Panel Data Economics 8379 ... Panel IV can be a solution to the measurement error

Introduction Random/FE/GLS IV Lagged Y Binary outcome models Application. Acemoglu et al. (2008, 2015) Panel data in Stata

Dynamic model

• A dynamic model:

Pr(yi | xi , ηi) =T∏

t=1

Pr(yit | yi,t−1, xit , ηi)

• Dynamic logit, fixed effects• Random effects

• The initial conditions problem.• Predetermined xit is difficult to model.

Page 47: Lecture 12 Panel Data · Acemoglu et al. (2008, 2015) Panel data in Stata Lecture 12 – Panel Data Economics 8379 ... Panel IV can be a solution to the measurement error

Introduction Random/FE/GLS IV Lagged Y Binary outcome models Application. Acemoglu et al. (2008, 2015) Panel data in Stata

Linear probability model

• In practice a linear probability model is often used• That is, yit = β′xit + ηi + νit , despite the fact that yit is binary.• This allows for fixed effects, various types of endogeneity,

Arellano and Bond GMM estimator, etc.

Page 48: Lecture 12 Panel Data · Acemoglu et al. (2008, 2015) Panel data in Stata Lecture 12 – Panel Data Economics 8379 ... Panel IV can be a solution to the measurement error

Introduction Random/FE/GLS IV Lagged Y Binary outcome models Application. Acemoglu et al. (2008, 2015) Panel data in Stata

Acemoglu et al.

• The effect of democracy on income.baseline model:

4.1 Baseline Results

Our main linear regression model takes the form

yct = βDct +

p∑

j=1

γjyct−j + αc + δt + εct, (1)

where yct is the log of GDP per capita in country c at time t, and Dct is our dichotomous measure

of democracy in country c at time t. The αc’s denote a full set of country fixed effects, which will

absorb the impact of any time-invariant country characteristics, and the δt’s denote a full set of

year effects. The error term εct includes all other time-varying unobservable shocks to GDP per

capita. The specification includes p lags of log GDP per capita on the right-hand side to control

for the dynamics of GDP as discussed in the Introduction.

We impose the following assumption:

Assumption 1 (sequential exogeneity): E(εct|yct−1, . . . , yct0 , Dct, . . . , Dct0 , αc, δt) = 0.

This is the standard assumption when dealing with dynamic panel models. It implies that

democracy and past GDP are orthogonal to contemporaneous and future error terms, and that the

error term εct is serially uncorrelated.

Assumption 1 effectively requires sufficiently many lags of GDP to be included in equation (1)

both to eliminate residual serial correlation in the error term of this equation and to remove the

pre-democratization dip in GDP.

We also assume (and test below) that GDP and democracy are stationary processes (conditional

on country and year fixed effects). Under Assumption 1 and stationarity, equation (1) can be

estimated using the standard within estimator.7 Columns 1-4 of Table 2 report the results of this

estimation controlling for different numbers of lags on our baseline sample of 175 countries between

the years of 1960 and 2010. Throughout, the reported coefficient of democracy is multiplied by 100

to ease its interpretation, and we report standard errors robust against heteroskedasticity.

The first column of the table controls for a single lag of GDP per capita on the right-hand side.

In a pattern common with all of the results we present in this paper, there is a sizable amount

of persistence in GDP, with a coefficient on lagged (log) GDP of 0.973 (standard error = 0.006).

7For future reference, we note that this involves the following “within transformation,”

yct − 1

Tc

s

ycs = β

(Dct − 1

Tc

s

Dcs

)+

p∑

j=1

γj

(yct−j − 1

Tc

s

ycs−j

)+ δt +

(εct − 1

Tc

s

εcs

),

with Tc being the number of times a country appears in the estimation sample. The within estimator has anasymptotic bias of order 1/T when Dct and yct−j are sequentially exogenous but not strictly exogenous, and whenboth series are cointegrated (this is the case if both are stationary as assumed). Thus, for long panels, as the one weuse, the within estimator provides a natural starting point.

8

main exogeneity

assumption

4.1 Baseline Results

Our main linear regression model takes the form

yct = βDct +

p∑

j=1

γjyct−j + αc + δt + εct, (1)

where yct is the log of GDP per capita in country c at time t, and Dct is our dichotomous measure

of democracy in country c at time t. The αc’s denote a full set of country fixed effects, which will

absorb the impact of any time-invariant country characteristics, and the δt’s denote a full set of

year effects. The error term εct includes all other time-varying unobservable shocks to GDP per

capita. The specification includes p lags of log GDP per capita on the right-hand side to control

for the dynamics of GDP as discussed in the Introduction.

We impose the following assumption:

Assumption 1 (sequential exogeneity): E(εct|yct−1, . . . , yct0 , Dct, . . . , Dct0 , αc, δt) = 0.

This is the standard assumption when dealing with dynamic panel models. It implies that

democracy and past GDP are orthogonal to contemporaneous and future error terms, and that the

error term εct is serially uncorrelated.

Assumption 1 effectively requires sufficiently many lags of GDP to be included in equation (1)

both to eliminate residual serial correlation in the error term of this equation and to remove the

pre-democratization dip in GDP.

We also assume (and test below) that GDP and democracy are stationary processes (conditional

on country and year fixed effects). Under Assumption 1 and stationarity, equation (1) can be

estimated using the standard within estimator.7 Columns 1-4 of Table 2 report the results of this

estimation controlling for different numbers of lags on our baseline sample of 175 countries between

the years of 1960 and 2010. Throughout, the reported coefficient of democracy is multiplied by 100

to ease its interpretation, and we report standard errors robust against heteroskedasticity.

The first column of the table controls for a single lag of GDP per capita on the right-hand side.

In a pattern common with all of the results we present in this paper, there is a sizable amount

of persistence in GDP, with a coefficient on lagged (log) GDP of 0.973 (standard error = 0.006).

7For future reference, we note that this involves the following “within transformation,”

yct − 1

Tc

s

ycs = β

(Dct − 1

Tc

s

Dcs

)+

p∑

j=1

γj

(yct−j − 1

Tc

s

ycs−j

)+ δt +

(εct − 1

Tc

s

εcs

),

with Tc being the number of times a country appears in the estimation sample. The within estimator has anasymptotic bias of order 1/T when Dct and yct−j are sequentially exogenous but not strictly exogenous, and whenboth series are cointegrated (this is the case if both are stationary as assumed). Thus, for long panels, as the one weuse, the within estimator provides a natural starting point.

8

Page 49: Lecture 12 Panel Data · Acemoglu et al. (2008, 2015) Panel data in Stata Lecture 12 – Panel Data Economics 8379 ... Panel IV can be a solution to the measurement error

Introduction Random/FE/GLS IV Lagged Y Binary outcome models Application. Acemoglu et al. (2008, 2015) Panel data in Stata

Acemoglu et al.

4.1 Baseline Results

Our main linear regression model takes the form

yct = βDct +

p∑

j=1

γjyct−j + αc + δt + εct, (1)

where yct is the log of GDP per capita in country c at time t, and Dct is our dichotomous measure

of democracy in country c at time t. The αc’s denote a full set of country fixed effects, which will

absorb the impact of any time-invariant country characteristics, and the δt’s denote a full set of

year effects. The error term εct includes all other time-varying unobservable shocks to GDP per

capita. The specification includes p lags of log GDP per capita on the right-hand side to control

for the dynamics of GDP as discussed in the Introduction.

We impose the following assumption:

Assumption 1 (sequential exogeneity): E(εct|yct−1, . . . , yct0 , Dct, . . . , Dct0 , αc, δt) = 0.

This is the standard assumption when dealing with dynamic panel models. It implies that

democracy and past GDP are orthogonal to contemporaneous and future error terms, and that the

error term εct is serially uncorrelated.

Assumption 1 effectively requires sufficiently many lags of GDP to be included in equation (1)

both to eliminate residual serial correlation in the error term of this equation and to remove the

pre-democratization dip in GDP.

We also assume (and test below) that GDP and democracy are stationary processes (conditional

on country and year fixed effects). Under Assumption 1 and stationarity, equation (1) can be

estimated using the standard within estimator.7 Columns 1-4 of Table 2 report the results of this

estimation controlling for different numbers of lags on our baseline sample of 175 countries between

the years of 1960 and 2010. Throughout, the reported coefficient of democracy is multiplied by 100

to ease its interpretation, and we report standard errors robust against heteroskedasticity.

The first column of the table controls for a single lag of GDP per capita on the right-hand side.

In a pattern common with all of the results we present in this paper, there is a sizable amount

of persistence in GDP, with a coefficient on lagged (log) GDP of 0.973 (standard error = 0.006).

7For future reference, we note that this involves the following “within transformation,”

yct − 1

Tc

s

ycs = β

(Dct − 1

Tc

s

Dcs

)+

p∑

j=1

γj

(yct−j − 1

Tc

s

ycs−j

)+ δt +

(εct − 1

Tc

s

εcs

),

with Tc being the number of times a country appears in the estimation sample. The within estimator has anasymptotic bias of order 1/T when Dct and yct−j are sequentially exogenous but not strictly exogenous, and whenboth series are cointegrated (this is the case if both are stationary as assumed). Thus, for long panels, as the one weuse, the within estimator provides a natural starting point.

8

Figure 2 plots the estimated impact of a permanent transition to democracy s years after the

event, with s ranging from 0 to 30, together with a 95% confidence interval. These estimates

are derived (extrapolated) directly from the dynamic process for GDP estimated in our preferred

specification. They imply that most of the long-run gain from democracy will have been realized

and GDP will be about 20% higher in 30 years.

Column 4 includes four more lags of GDP (for a total of eight lags). We do not present their

coefficients and just report the p-value for a joint test of significance, which suggests they do not

jointly affect current GDP dynamics. The overall degree of persistence and the long-run effect of

democracy on GDP per capita are very similar to the estimates in column 3.

The within group estimates of the dynamic panel model in columns 1-4 have an asymptotic

bias of order 1/T , which is known, after Nickell (1981), as the Nickell bias. This bias results from

the failure of strict exogeneity in models with lagged dependent variables on the right-hand side

as in our equation (1) (Nickell 1981, Alvarez and Arellano 2003). Because T is fairly large in our

panel (on average, each country is observed 38.8 times), this bias should be small in our setting,

motivating our use of the model in columns 1-4 as the baseline.10

The rest of Table 2 reports various GMM estimators that deal with the Nickel bias, and produce

consistent estimates of the dynamic panel model for finite T . Sequential exogeneity implies the

following moment conditions

E[(εct − εct−1)(ycs, Dcs+1)′] = 0 for all s ≤ t− 2.

Arellano and Bond (1991) develop a GMM estimator based on these moments. In columns 5-8, we

report estimates from the same four models reported in columns 1-4 using this GMM procedure.

Consistent with our expectations that the within estimator has at most a small bias, the GMM

estimates are very similar to our preferred specification in column 3. The only notable difference

is that GMM estimates imply slightly smaller persistence for the GDP process, leading to smaller

long-run effects. For example, column 7, which corresponds to the GMM estimates analogous to our

preferred specification in column 3, shows a long-run impact of 16.45% (standard error=8.436%)

on GDP per capita following a permanent transition to democracy.

In addition, we also report the p-values of a test for serial correlation in the residuals of equation

(1) which, as required by Assumption 1, tests whether there is AR2 correlation in the differenced

residuals. The p-values for this test indicate that this assumption is not rejected when we include

10Returning to footnote 7, this bias can be understood as a consequence of the fact that for fixed Tc, the term1Tc

∑s εcs in the transformed error is mechanically correlated with yct−j and Dct. Clearly as Tc tends to infinity, this

bias disappears as long as the process for GDP and democracy are weakly dependent over time, as we have assumed.In the text, we simplify the discussion by referring to T , the average number of times a country appears in the panel.

Judson and Owen’s (1999) Monte Carlo results suggest that, in standard macro datasets, the Nickell bias is of theorder of 1% for T = 30, further suggesting that it is not a major concern in our empirical setting.

10

The Arellano-Bond approach is susceptible to many/weakinstruments bias so they also use a weak-instrumentrobust method for panel data due to Hahn, Hausman, andKuersteiner (2003)

Page 50: Lecture 12 Panel Data · Acemoglu et al. (2008, 2015) Panel data in Stata Lecture 12 – Panel Data Economics 8379 ... Panel IV can be a solution to the measurement error

Introduction Random/FE/GLS IV Lagged Y Binary outcome models Application. Acemoglu et al. (2008, 2015) Panel data in Stata

Acemoglu et al.

4.1 Baseline Results

Our main linear regression model takes the form

yct = βDct +

p∑

j=1

γjyct−j + αc + δt + εct, (1)

where yct is the log of GDP per capita in country c at time t, and Dct is our dichotomous measure

of democracy in country c at time t. The αc’s denote a full set of country fixed effects, which will

absorb the impact of any time-invariant country characteristics, and the δt’s denote a full set of

year effects. The error term εct includes all other time-varying unobservable shocks to GDP per

capita. The specification includes p lags of log GDP per capita on the right-hand side to control

for the dynamics of GDP as discussed in the Introduction.

We impose the following assumption:

Assumption 1 (sequential exogeneity): E(εct|yct−1, . . . , yct0 , Dct, . . . , Dct0 , αc, δt) = 0.

This is the standard assumption when dealing with dynamic panel models. It implies that

democracy and past GDP are orthogonal to contemporaneous and future error terms, and that the

error term εct is serially uncorrelated.

Assumption 1 effectively requires sufficiently many lags of GDP to be included in equation (1)

both to eliminate residual serial correlation in the error term of this equation and to remove the

pre-democratization dip in GDP.

We also assume (and test below) that GDP and democracy are stationary processes (conditional

on country and year fixed effects). Under Assumption 1 and stationarity, equation (1) can be

estimated using the standard within estimator.7 Columns 1-4 of Table 2 report the results of this

estimation controlling for different numbers of lags on our baseline sample of 175 countries between

the years of 1960 and 2010. Throughout, the reported coefficient of democracy is multiplied by 100

to ease its interpretation, and we report standard errors robust against heteroskedasticity.

The first column of the table controls for a single lag of GDP per capita on the right-hand side.

In a pattern common with all of the results we present in this paper, there is a sizable amount

of persistence in GDP, with a coefficient on lagged (log) GDP of 0.973 (standard error = 0.006).

7For future reference, we note that this involves the following “within transformation,”

yct − 1

Tc

s

ycs = β

(Dct − 1

Tc

s

Dcs

)+

p∑

j=1

γj

(yct−j − 1

Tc

s

ycs−j

)+ δt +

(εct − 1

Tc

s

εcs

),

with Tc being the number of times a country appears in the estimation sample. The within estimator has anasymptotic bias of order 1/T when Dct and yct−j are sequentially exogenous but not strictly exogenous, and whenboth series are cointegrated (this is the case if both are stationary as assumed). Thus, for long panels, as the one weuse, the within estimator provides a natural starting point.

8

Figure 2 plots the estimated impact of a permanent transition to democracy s years after the

event, with s ranging from 0 to 30, together with a 95% confidence interval. These estimates

are derived (extrapolated) directly from the dynamic process for GDP estimated in our preferred

specification. They imply that most of the long-run gain from democracy will have been realized

and GDP will be about 20% higher in 30 years.

Column 4 includes four more lags of GDP (for a total of eight lags). We do not present their

coefficients and just report the p-value for a joint test of significance, which suggests they do not

jointly affect current GDP dynamics. The overall degree of persistence and the long-run effect of

democracy on GDP per capita are very similar to the estimates in column 3.

The within group estimates of the dynamic panel model in columns 1-4 have an asymptotic

bias of order 1/T , which is known, after Nickell (1981), as the Nickell bias. This bias results from

the failure of strict exogeneity in models with lagged dependent variables on the right-hand side

as in our equation (1) (Nickell 1981, Alvarez and Arellano 2003). Because T is fairly large in our

panel (on average, each country is observed 38.8 times), this bias should be small in our setting,

motivating our use of the model in columns 1-4 as the baseline.10

The rest of Table 2 reports various GMM estimators that deal with the Nickel bias, and produce

consistent estimates of the dynamic panel model for finite T . Sequential exogeneity implies the

following moment conditions

E[(εct − εct−1)(ycs, Dcs+1)′] = 0 for all s ≤ t− 2.

Arellano and Bond (1991) develop a GMM estimator based on these moments. In columns 5-8, we

report estimates from the same four models reported in columns 1-4 using this GMM procedure.

Consistent with our expectations that the within estimator has at most a small bias, the GMM

estimates are very similar to our preferred specification in column 3. The only notable difference

is that GMM estimates imply slightly smaller persistence for the GDP process, leading to smaller

long-run effects. For example, column 7, which corresponds to the GMM estimates analogous to our

preferred specification in column 3, shows a long-run impact of 16.45% (standard error=8.436%)

on GDP per capita following a permanent transition to democracy.

In addition, we also report the p-values of a test for serial correlation in the residuals of equation

(1) which, as required by Assumption 1, tests whether there is AR2 correlation in the differenced

residuals. The p-values for this test indicate that this assumption is not rejected when we include

10Returning to footnote 7, this bias can be understood as a consequence of the fact that for fixed Tc, the term1Tc

∑s εcs in the transformed error is mechanically correlated with yct−j and Dct. Clearly as Tc tends to infinity, this

bias disappears as long as the process for GDP and democracy are weakly dependent over time, as we have assumed.In the text, we simplify the discussion by referring to T , the average number of times a country appears in the panel.

Judson and Owen’s (1999) Monte Carlo results suggest that, in standard macro datasets, the Nickell bias is of theorder of 1% for T = 30, further suggesting that it is not a major concern in our empirical setting.

10

The Arellano-Bond approach is susceptible to many/weakinstruments bias so they also use a weak-instrumentrobust method for panel data due to Hahn, Hausman, andKuersteiner (2003)

Page 51: Lecture 12 Panel Data · Acemoglu et al. (2008, 2015) Panel data in Stata Lecture 12 – Panel Data Economics 8379 ... Panel IV can be a solution to the measurement error

Introduction Random/FE/GLS IV Lagged Y Binary outcome models Application. Acemoglu et al. (2008, 2015) Panel data in Stata

Acemoglu et al.

4.1 Baseline Results

Our main linear regression model takes the form

yct = βDct +

p∑

j=1

γjyct−j + αc + δt + εct, (1)

where yct is the log of GDP per capita in country c at time t, and Dct is our dichotomous measure

of democracy in country c at time t. The αc’s denote a full set of country fixed effects, which will

absorb the impact of any time-invariant country characteristics, and the δt’s denote a full set of

year effects. The error term εct includes all other time-varying unobservable shocks to GDP per

capita. The specification includes p lags of log GDP per capita on the right-hand side to control

for the dynamics of GDP as discussed in the Introduction.

We impose the following assumption:

Assumption 1 (sequential exogeneity): E(εct|yct−1, . . . , yct0 , Dct, . . . , Dct0 , αc, δt) = 0.

This is the standard assumption when dealing with dynamic panel models. It implies that

democracy and past GDP are orthogonal to contemporaneous and future error terms, and that the

error term εct is serially uncorrelated.

Assumption 1 effectively requires sufficiently many lags of GDP to be included in equation (1)

both to eliminate residual serial correlation in the error term of this equation and to remove the

pre-democratization dip in GDP.

We also assume (and test below) that GDP and democracy are stationary processes (conditional

on country and year fixed effects). Under Assumption 1 and stationarity, equation (1) can be

estimated using the standard within estimator.7 Columns 1-4 of Table 2 report the results of this

estimation controlling for different numbers of lags on our baseline sample of 175 countries between

the years of 1960 and 2010. Throughout, the reported coefficient of democracy is multiplied by 100

to ease its interpretation, and we report standard errors robust against heteroskedasticity.

The first column of the table controls for a single lag of GDP per capita on the right-hand side.

In a pattern common with all of the results we present in this paper, there is a sizable amount

of persistence in GDP, with a coefficient on lagged (log) GDP of 0.973 (standard error = 0.006).

7For future reference, we note that this involves the following “within transformation,”

yct − 1

Tc

s

ycs = β

(Dct − 1

Tc

s

Dcs

)+

p∑

j=1

γj

(yct−j − 1

Tc

s

ycs−j

)+ δt +

(εct − 1

Tc

s

εcs

),

with Tc being the number of times a country appears in the estimation sample. The within estimator has anasymptotic bias of order 1/T when Dct and yct−j are sequentially exogenous but not strictly exogenous, and whenboth series are cointegrated (this is the case if both are stationary as assumed). Thus, for long panels, as the one weuse, the within estimator provides a natural starting point.

8

Figure 2 plots the estimated impact of a permanent transition to democracy s years after the

event, with s ranging from 0 to 30, together with a 95% confidence interval. These estimates

are derived (extrapolated) directly from the dynamic process for GDP estimated in our preferred

specification. They imply that most of the long-run gain from democracy will have been realized

and GDP will be about 20% higher in 30 years.

Column 4 includes four more lags of GDP (for a total of eight lags). We do not present their

coefficients and just report the p-value for a joint test of significance, which suggests they do not

jointly affect current GDP dynamics. The overall degree of persistence and the long-run effect of

democracy on GDP per capita are very similar to the estimates in column 3.

The within group estimates of the dynamic panel model in columns 1-4 have an asymptotic

bias of order 1/T , which is known, after Nickell (1981), as the Nickell bias. This bias results from

the failure of strict exogeneity in models with lagged dependent variables on the right-hand side

as in our equation (1) (Nickell 1981, Alvarez and Arellano 2003). Because T is fairly large in our

panel (on average, each country is observed 38.8 times), this bias should be small in our setting,

motivating our use of the model in columns 1-4 as the baseline.10

The rest of Table 2 reports various GMM estimators that deal with the Nickel bias, and produce

consistent estimates of the dynamic panel model for finite T . Sequential exogeneity implies the

following moment conditions

E[(εct − εct−1)(ycs, Dcs+1)′] = 0 for all s ≤ t− 2.

Arellano and Bond (1991) develop a GMM estimator based on these moments. In columns 5-8, we

report estimates from the same four models reported in columns 1-4 using this GMM procedure.

Consistent with our expectations that the within estimator has at most a small bias, the GMM

estimates are very similar to our preferred specification in column 3. The only notable difference

is that GMM estimates imply slightly smaller persistence for the GDP process, leading to smaller

long-run effects. For example, column 7, which corresponds to the GMM estimates analogous to our

preferred specification in column 3, shows a long-run impact of 16.45% (standard error=8.436%)

on GDP per capita following a permanent transition to democracy.

In addition, we also report the p-values of a test for serial correlation in the residuals of equation

(1) which, as required by Assumption 1, tests whether there is AR2 correlation in the differenced

residuals. The p-values for this test indicate that this assumption is not rejected when we include

10Returning to footnote 7, this bias can be understood as a consequence of the fact that for fixed Tc, the term1Tc

∑s εcs in the transformed error is mechanically correlated with yct−j and Dct. Clearly as Tc tends to infinity, this

bias disappears as long as the process for GDP and democracy are weakly dependent over time, as we have assumed.In the text, we simplify the discussion by referring to T , the average number of times a country appears in the panel.

Judson and Owen’s (1999) Monte Carlo results suggest that, in standard macro datasets, the Nickell bias is of theorder of 1% for T = 30, further suggesting that it is not a major concern in our empirical setting.

10

The Arellano-Bond approach is susceptible to many/weakinstruments bias so they also use a weak-instrumentrobust method for panel data due to Hahn, Hausman, andKuersteiner (2003)

Page 52: Lecture 12 Panel Data · Acemoglu et al. (2008, 2015) Panel data in Stata Lecture 12 – Panel Data Economics 8379 ... Panel IV can be a solution to the measurement error

Introduction Random/FE/GLS IV Lagged Y Binary outcome models Application. Acemoglu et al. (2008, 2015) Panel data in Stata

Acemoglu et al.

TABLE 2: EFFECT OF DEMOCRACY ON (LOG) GDP PER CAPITA.

Within estimates Arellano and Bond estimates HHK estimates

(1) (2) (3) (4) (5) (6) (7) (8) (9) (10) (11) (12)

Democracy 0.973 0.651 0.787 0.887 0.959 0.797 0.875 0.659 0.781 0.582 1.178 1.700(0.294) (0.248) (0.226) (0.245) (0.477) (0.417) (0.374) (0.378) (0.467) (0.357) (0.346) (0.321)

log GDP first lag 0.973 1.266 1.238 1.233 0.946 1.216 1.204 1.204 0.938 1.158 1.150 1.156(0.006) (0.038) (0.038) (0.039) (0.009) (0.041) (0.041) (0.038) (0.009) (0.046) (0.047) (0.038)

log GDP second lag -0.300 -0.207 -0.214 -0.270 -0.193 -0.205 -0.217 -0.127 -0.122(0.037) (0.046) (0.043) (0.038) (0.045) (0.042) (0.043) (0.055) (0.043)

log GDP third lag -0.026 -0.021 -0.028 -0.020 -0.030 -0.041(0.028) (0.028) (0.028) (0.027) (0.026) (0.024)

log GDP fourth lag -0.043 -0.039 -0.036 -0.038 -0.039 -0.028(0.017) (0.034) (0.020) (0.033) (0.017) (0.028)

Long-run effect of democracy 35.587 19.599 21.240 22.008 17.608 14.882 16.448 11.810 12.644 9.929 25.032 35.826(13.998) (8.595) (7.215) (7.740) (10.609) (9.152) (8.436) (7.829) (7.790) (6.269) (9.031) (9.597)

Effect of democracy after 25 years 17.791 13.800 16.895 17.715 13.263 12.721 14.713 10.500 10.076 8.537 20.853 30.043(5.649) (5.550) (5.297) (5.455) (7.281) (7.371) (7.128) (6.653) (6.086) (5.311) (6.814) (6.815)

Persistence of GDP process 0.973 0.967 0.963 0.960 0.946 0.946 0.947 0.944 0.938 0.941 0.953 0.953(0.006) (0.005) (0.005) (0.007) (0.009) (0.009) (0.009) (0.009) (0.009) (0.009) (0.008) (0.008)

Unit root test adjusted t−stat -4.791 -3.892 -4.127 -6.991p− value (rejects unit root) [0.000] [0.000] [0.000] [0.000]AR2 test p-value 0.01 0.08 0.51 0.95Observations 6,790 6,642 6,336 5,688 6,615 6,467 6,161 5,513 6,615 6,467 6,161 5,513Countries in sample 175 175 175 175 175 175 175 175 175 175 175 175

Notes: This table presents estimates of the effect of democracy on log GDP per capita. The reported coefficient on democracy is multiplied by 100. Columns1-4 present results using the within estimator. Columns 5-8 present results using Arellano and Bond’s GMM estimator. The AR2 row reports the p-value fora test of serial correlation in the residuals. Columns 9-12 present results using the HHK estimator. In all specifications we control for a full set of country andyear fixed effects. Columns 4, 8 and 12 include 8 lags of GDP per capita as controls, but we only report the p-value of a test for joint significance of lags 5 to 8.Standard errors robust against heteroskedasticity and serial correlation at the country level are reported in parentheses.

42

Page 53: Lecture 12 Panel Data · Acemoglu et al. (2008, 2015) Panel data in Stata Lecture 12 – Panel Data Economics 8379 ... Panel IV can be a solution to the measurement error

Introduction Random/FE/GLS IV Lagged Y Binary outcome models Application. Acemoglu et al. (2008, 2015) Panel data in Stata

Basic panel commands

• Stata has a suite of panel commands such as xtreg• But you can use cross-sectional tools to do most of this,

sometimes with some difficulty.• I won’t go over the basics but some commands you should

be familiar with:• xtset• reshape• egen• xtreg• xtsum, xttab,xttrans

Page 54: Lecture 12 Panel Data · Acemoglu et al. (2008, 2015) Panel data in Stata Lecture 12 – Panel Data Economics 8379 ... Panel IV can be a solution to the measurement error

Introduction Random/FE/GLS IV Lagged Y Binary outcome models Application. Acemoglu et al. (2008, 2015) Panel data in Stata

Panel regression in Stata

• xtreg can be used to estimate pooled OLS, FE, and RE• The first differences estimator can be estimated using regD.(yvar xvar1 xvar2), options

• Standard errors that are robust to heterosk. and serialcorrelation – vce(cluster id) or vce(robust) forxtreg

• Both of these can handle unbalanced panels as well.• Other FGLS estimators can be implemented manually or,

in some cases, using xtreg, pa, xtgls or xtgee• Comparing FE and RE – use hausman to conduct the

specification test

Page 55: Lecture 12 Panel Data · Acemoglu et al. (2008, 2015) Panel data in Stata Lecture 12 – Panel Data Economics 8379 ... Panel IV can be a solution to the measurement error

Introduction Random/FE/GLS IV Lagged Y Binary outcome models Application. Acemoglu et al. (2008, 2015) Panel data in Stata

Panel IV estimation in Stata

• ivregress and ivreg2 can be used for most panel IVregressions if the data is appropriately transformed and theinstrument vector is appropriately defined.

• This is useful sometimes because it gives moretransparent control over what moment conditions are used.

• The xtivreg command, however, can be easier to workwith.

Page 56: Lecture 12 Panel Data · Acemoglu et al. (2008, 2015) Panel data in Stata Lecture 12 – Panel Data Economics 8379 ... Panel IV can be a solution to the measurement error

Introduction Random/FE/GLS IV Lagged Y Binary outcome models Application. Acemoglu et al. (2008, 2015) Panel data in Stata

Panel IV estimation in Stata

• xtivreg:• options fe, fd,re allow different transformations of data• this command uses what Cameron and Trivedi call the

“summation” moment conditions• it differences the instruments as well

Page 57: Lecture 12 Panel Data · Acemoglu et al. (2008, 2015) Panel data in Stata Lecture 12 – Panel Data Economics 8379 ... Panel IV can be a solution to the measurement error

Introduction Random/FE/GLS IV Lagged Y Binary outcome models Application. Acemoglu et al. (2008, 2015) Panel data in Stata

Panel IV estimation in Stata

• lagged dependent variables:• one solution is to work with the first differences model,

using ivregress or xtivreg• xtabond can be used to implement versions of the

Arellano Bond (1991) estimator that incorporate otherinstruments

Page 58: Lecture 12 Panel Data · Acemoglu et al. (2008, 2015) Panel data in Stata Lecture 12 – Panel Data Economics 8379 ... Panel IV can be a solution to the measurement error

Introduction Random/FE/GLS IV Lagged Y Binary outcome models Application. Acemoglu et al. (2008, 2015) Panel data in Stata

Panel IV estimation in Stata

• xtabond:• this only works if you want to include a lagged dependent

variable• you can flexibly specify how many lags to include• you can flexibly specify which regressors are exogenous,

endogenous, or predetermined• we will see some examples of the syntax in a few minutes

Page 59: Lecture 12 Panel Data · Acemoglu et al. (2008, 2015) Panel data in Stata Lecture 12 – Panel Data Economics 8379 ... Panel IV can be a solution to the measurement error

Introduction Random/FE/GLS IV Lagged Y Binary outcome models Application. Acemoglu et al. (2008, 2015) Panel data in Stata

Other panel IV commands in Stata

• xtabond2 is a user-written code that has a few additionalfeatures

• the command xtdpdsys command implements Arellanoand Bover (1995) and Blundell and Bond (1998)

• xthtaylor implements an alternative panel IV estimator(Hausman-Taylor)