23
Economics 6003 Quantitative Economics John Bluedorn Panel Data What is panel data? A note on asymptotics Linear Panel Data Models General single equation model Linear unobserved effects panel model Random effects panel model Fixed effects panel model Classic linear panel estimation Related models Panel model application – Currency unions and trade Summary Economics 6003 Quantitative Economics Classic Static Panel Models // Random and Fixed Effects John Bluedorn Lecturer, Economics Division Monday/Thursday, 27/30 April 2009 Lecture 06 EC6003, Quantitative Economics (1 of 23)

Classic Static Panel Models

Embed Size (px)

DESCRIPTION

Classic statics panel models

Citation preview

Page 1: Classic Static Panel Models

Economics6003

QuantitativeEconomics

John Bluedorn

Panel Data

What is paneldata?

A note onasymptotics

Linear PanelData Models

General singleequation model

Linearunobservedeffects panelmodel

Random effectspanel model

Fixed effectspanel model

Classic linearpanel estimation

Related models

Panel modelapplication –Currencyunions andtrade

Summary

Economics 6003Quantitative Economics

Classic Static Panel Models // Random and Fixed Effects

John Bluedorn

Lecturer, Economics Division

Monday/Thursday, 27/30 April 2009

Lecture 06 EC6003, Quantitative Economics (1 of 23)

Page 2: Classic Static Panel Models

Economics6003

QuantitativeEconomics

John Bluedorn

Panel Data

What is paneldata?

A note onasymptotics

Linear PanelData Models

General singleequation model

Linearunobservedeffects panelmodel

Random effectspanel model

Fixed effectspanel model

Classic linearpanel estimation

Related models

Panel modelapplication –Currencyunions andtrade

Summary

What is panel data?

• Up to now, we have only considered either:• cross-sectional data(no natural order)• time-series data (naturally ordered)

• Panel data is characterized by both a cross-section andtime element → an ordered series (usually time) exists foreach cross-sectional unit.

• Let i index the cross-section dimension of the data, wherei = 1, . . .N (there are a total of N cross-sectional units).

• Each i is sometimes referred to as a panel ⇒ panel data isa collection of panels.

• Let t index the time series dimension of the data, wheret = 1, . . .Ti for each cross-sectional unit i .

• If Ti = T∀i , then the sample is balanced. Otherwise, it isunbalanced.

• We will assume that panels are balanced for simplicity.

• The sample size of a panel dataset is thus NT .

Lecture 06 EC6003, Quantitative Economics (2 of 23)

Page 3: Classic Static Panel Models

Economics6003

QuantitativeEconomics

John Bluedorn

Panel Data

What is paneldata?

A note onasymptotics

Linear PanelData Models

General singleequation model

Linearunobservedeffects panelmodel

Random effectspanel model

Fixed effectspanel model

Classic linearpanel estimation

Related models

Panel modelapplication –Currencyunions andtrade

Summary

Examples of possible panels

• The critical characteristic of the set of cross-section units(panels) is that that do not have a natural order that wecan leverage.

• Thus, example panels include:• individuals/people• families• households• firms• countries• relationships

• individual-location• bilateral country import-export pairs• bilateral firm buyer-seller pairs

• NB: If there is some non-temporal ordering of thecross-section units (e.g., geographic proximities), weshould incorporate that information into our approach,either directly through additional explanatory variables orstructure on the error term.

Lecture 06 EC6003, Quantitative Economics (3 of 23)

Page 4: Classic Static Panel Models

Economics6003

QuantitativeEconomics

John Bluedorn

Panel Data

What is paneldata?

A note onasymptotics

Linear PanelData Models

General singleequation model

Linearunobservedeffects panelmodel

Random effectspanel model

Fixed effectspanel model

Classic linearpanel estimation

Related models

Panel modelapplication –Currencyunions andtrade

Summary

A note on asymptotics

• The usual desiderata of estimators are consistency andefficiency. As asymptotic properties, they arise only as thesample size goes to infinity.

• With panel data, there are 2 dimensions which can go toinfinity: N or T . Thus, we can outline 3 kinds ofasymptotics:

1 N asymptotics – we consider T fixed and ask how theestimator behaves as the number of cross-section unitsgoes to infinity. Things behave like cross-sections, with alittle extra information afforded by T .

2 T asymptotics – we consider N fixed and ask how theestimator behaves as the number of time periods goes toinfinity. Things behave like time series.

3 NT asymptotics – both N and T go to infinity.

• Consistency and efficiency can only be evaluated relativeto one of these asymptotic cases.

Lecture 06 EC6003, Quantitative Economics (4 of 23)

Page 5: Classic Static Panel Models

Economics6003

QuantitativeEconomics

John Bluedorn

Panel Data

What is paneldata?

A note onasymptotics

Linear PanelData Models

General singleequation model

Linearunobservedeffects panelmodel

Random effectspanel model

Fixed effectspanel model

Classic linearpanel estimation

Related models

Panel modelapplication –Currencyunions andtrade

Summary

General single equation model

• Consider the most general, single equation linear paneldata model:

yi ,t(1×1)

= β′i ,t(1×K)

xi ,t(K×1)

+ ui ,t

where y and x are observables, β is a set of unknownparameters, and u is unobservable.

• In general, we would like to learn something about β. Inthe absence of additional restrictions though, we cannotestimate the model:

• the number of parameters (elements of β) is equal to thesize of the sample.

• the relationship between the observables and theunobservables is unspecified; there could be confounding.

• First, let’s suppose that βi ,t = β∀i , t.• Second, let’s also assume that ui ,t = αi + εi ,t .

Lecture 06 EC6003, Quantitative Economics (5 of 23)

Page 6: Classic Static Panel Models

Economics6003

QuantitativeEconomics

John Bluedorn

Panel Data

What is paneldata?

A note onasymptotics

Linear PanelData Models

General singleequation model

Linearunobservedeffects panelmodel

Random effectspanel model

Fixed effectspanel model

Classic linearpanel estimation

Related models

Panel modelapplication –Currencyunions andtrade

Summary

Linear unobserved effects panel model

• Then, the linear panel data model has the form:

yi ,t = β′xi ,t + αi + εi ,t

where αi is an unobserved, cross-section unit-specificeffect and εi ,t is an unobserved, idiosyncratic error term.αi is also referred to as unobserved, time-invariant,cross-sectional heterogeneity.

• Consider the following assumptions on the relationshipbetween the observables and unobservables:

1 E (εi,t |αi , xi ) = E (εi,t |αi , xi,t) = 0∀t.• There is no correlation between αi and εi,t conditional

upon xi,t . Furthermore, additional information on the timeseries of xi is irrelevant. This is strict exogeneity of theobservable regressors conditional on the unobserved effect.

2 E (αi |xi ) = E (αi ) = 0∀t.• The observable regressors contain no useful information

about the unobserved effect. If this fails, then αi is arelevant, omitted variable and inconsistency results if weconsider N-asymptotics.

Lecture 06 EC6003, Quantitative Economics (6 of 23)

Page 7: Classic Static Panel Models

Economics6003

QuantitativeEconomics

John Bluedorn

Panel Data

What is paneldata?

A note onasymptotics

Linear PanelData Models

General singleequation model

Linearunobservedeffects panelmodel

Random effectspanel model

Fixed effectspanel model

Classic linearpanel estimation

Related models

Panel modelapplication –Currencyunions andtrade

Summary

Random effects panel model

• Under these assumptions, αi behaves just like acomponent of the unobserved error term.

• Such a model of αi is known as a random effects model.• We can use this structure to improve efficiency →

Generalized-least-squares (GLS) allows us to incorporatethe information in the variance/covariance matrix toimprove the efficiency of our estimator.

• Assume that:

E(εε′)

= σ2ε INT

E(αα′)

= σ2αIN

⇒ Each unobserved component exhibits homoskedasticityand is uncorrelated with the regressors and the otherunobserved components.

Lecture 06 EC6003, Quantitative Economics (7 of 23)

Page 8: Classic Static Panel Models

Economics6003

QuantitativeEconomics

John Bluedorn

Panel Data

What is paneldata?

A note onasymptotics

Linear PanelData Models

General singleequation model

Linearunobservedeffects panelmodel

Random effectspanel model

Fixed effectspanel model

Classic linearpanel estimation

Related models

Panel modelapplication –Currencyunions andtrade

Summary

Random effects panel model

• Then, the (T × T ) variance/covariance block for eachpanel has the structure:

E[(αi + εi ) (αi + εi )

′] =σ2α + σ2

ε σ2α · · · σ2

α

σ2α σ2

α + σ2ε

. . ....

.... . .

. . . σ2α

σ2α · · · σ2

α σ2α + σ2

ε

.The full (NT × NT ) variance/covariance matrix containszeros for the off-diagonal, covariances across panels.

• If we impose such a structure on the variance/covariancematrix used by GLS, we can achieve an additionalefficiency gain. Call this the RE estimator.

Lecture 06 EC6003, Quantitative Economics (8 of 23)

Page 9: Classic Static Panel Models

Economics6003

QuantitativeEconomics

John Bluedorn

Panel Data

What is paneldata?

A note onasymptotics

Linear PanelData Models

General singleequation model

Linearunobservedeffects panelmodel

Random effectspanel model

Fixed effectspanel model

Classic linearpanel estimation

Related models

Panel modelapplication –Currencyunions andtrade

Summary

Fixed effects panel model

• Assumption 2 is strong. If we drop it, then the unobservedcross-section unit-specific effect may be correlated withthe observed regressors.

• Such a model of αi is known as a fixed effects model. Inthis case, we must address the presence of the effect moredirectly; it is a relevant, omitted variable.

• We consider three ways to accomplish this:

1 Time de-meaning within panel and OLS estimation → theclassic fixed effects estimator. Denote this FE.

2 Panel dummy variables and OLS estimation → sometimesknown as least-squares dummy variables. Denote this DV.

3 Time differencing within panel and OLS estimation →usually done with the first difference. Denote this FD.

Lecture 06 EC6003, Quantitative Economics (9 of 23)

Page 10: Classic Static Panel Models

Economics6003

QuantitativeEconomics

John Bluedorn

Panel Data

What is paneldata?

A note onasymptotics

Linear PanelData Models

General singleequation model

Linearunobservedeffects panelmodel

Random effectspanel model

Fixed effectspanel model

Classic linearpanel estimation

Related models

Panel modelapplication –Currencyunions andtrade

Summary

Time de-meaning within panel

• Time de-meaning is the classic method of estimating afixed effects model.

• Construct the panel-specific time average:

yi = β′xi + αi + εi .

• Subtracting the time average from the panel modelequation, we have that:

(yi,t − yi ) = β′ (xi,t − xi ) + (εi,t − εi )

where the fixed effect αi vanishes since it is time-invariant.

• This is also known as the within transformation, since theOLS estimator of β only uses the within-panel timevariation. It will be consistent, since assumption 1 ensureszero correlation of the observable regressors and the errorterm.

Lecture 06 EC6003, Quantitative Economics (10 of 23)

Page 11: Classic Static Panel Models

Economics6003

QuantitativeEconomics

John Bluedorn

Panel Data

What is paneldata?

A note onasymptotics

Linear PanelData Models

General singleequation model

Linearunobservedeffects panelmodel

Random effectspanel model

Fixed effectspanel model

Classic linearpanel estimation

Related models

Panel modelapplication –Currencyunions andtrade

Summary

Panel-specific dummy variables

• A simple alternative to the within alternative (which canbe shown to be equivalent) is the introduce a set of Npanel-specific dummy variables into the regression. Theseeffectively proxy for the unobserved fixed effects, acting aspanel-specific intercepts. The OLS estimator of β isconsistent under N-asymptotics.

• The estimating equation for the regression is:

yi,t = β′xi,t +N∑

i=1

αiDi + εi,t

where Di is a dummy variable that takes the value of 1 ifthe observation is from panel i and zero otherwise.

• Note that the α coefficients for the dummy variables arenot consistent estimators of the unobserved fixed effectunder N-asymptotics.

Lecture 06 EC6003, Quantitative Economics (11 of 23)

Page 12: Classic Static Panel Models

Economics6003

QuantitativeEconomics

John Bluedorn

Panel Data

What is paneldata?

A note onasymptotics

Linear PanelData Models

General singleequation model

Linearunobservedeffects panelmodel

Random effectspanel model

Fixed effectspanel model

Classic linearpanel estimation

Related models

Panel modelapplication –Currencyunions andtrade

Summary

Within-panel time differences

• The final alternative for estimating a fixed effectsregression is to use within-panel time differences toeliminate the unobserved fixed effects.

• The first difference transformation is the most commonchoice:

(yi,t − yi,t−1) = β′ (xi,t − xi,t−1) + (εi,t − εi,t−1)⇒∆yi,t = β′∆xi,t + ∆εi,t

where the fixed effect αi vanishes since it is time-invariant.The OLS estimator for β will be consistent under the firstassumption.

• First-differencing is generally preferred since it only loses 1observation per panel and requires somewhat weaker zerocorrelation assumptions for the regressors and the errorterm in the level specification than higher order differences.

Lecture 06 EC6003, Quantitative Economics (12 of 23)

Page 13: Classic Static Panel Models

Economics6003

QuantitativeEconomics

John Bluedorn

Panel Data

What is paneldata?

A note onasymptotics

Linear PanelData Models

General singleequation model

Linearunobservedeffects panelmodel

Random effectspanel model

Fixed effectspanel model

Classic linearpanel estimation

Related models

Panel modelapplication –Currencyunions andtrade

Summary

Classic linear panel estimation

• The three approaches for fixed effects lead to identicalestimation results for the coefficients. However, thestandard errors are slightly different across each, but theusual canned statistical routines take account of this.

• Note that if we use fixed effects, we cannot include anytime-invariant regressors, since they will either vanishunder the FE or FD approaches or be exactly collinearwith the dummy variables under the DV approach. We areable to include such regressors in an RE model.

• In general, it is advisable to include a set of time dummiesin the model (FE or RE). These account for an arbitrarynon-linear trend that is common across units ⇒ use xii.time to generate a set.

• It is also often advisable to account for possiblewithin-unit autocorrelation, by using a HAC-robustvariance/covariance estimator for the standard errors.

Lecture 06 EC6003, Quantitative Economics (13 of 23)

Page 14: Classic Static Panel Models

Economics6003

QuantitativeEconomics

John Bluedorn

Panel Data

What is paneldata?

A note onasymptotics

Linear PanelData Models

General singleequation model

Linearunobservedeffects panelmodel

Random effectspanel model

Fixed effectspanel model

Classic linearpanel estimation

Related models

Panel modelapplication –Currencyunions andtrade

Summary

Classic linear panel estimation

• In Stata, each of these estimators are readily implementedafter you have read in your panel data and tsset it.

• For random effects, you can use xtreg depvar explvar,re vce(option ).

• For fixed effects:• The FE estimator (time de-meaning) ⇒ xtreg depvar

explvar, fe vce(option ).• The DV estimator ⇒ xi: regress depvar explvar

i.panelid, vce(option ).• The FD estimator ⇒ use the difference or lag operators,

such as regress d.depvar d.explvar, vce(option ).

• Note that it is feasible to estimate the marginal effect of atime-invariant regressor in a fixed effects model byinteracting it with a time-varying regressor. Obviously, theinterpretation of the coefficient changes, since it representsthe marginal effect of the time-invariant regressorevaluated at some level of the time-varying variable withwhich it is interacted.

Lecture 06 EC6003, Quantitative Economics (14 of 23)

Page 15: Classic Static Panel Models

Economics6003

QuantitativeEconomics

John Bluedorn

Panel Data

What is paneldata?

A note onasymptotics

Linear PanelData Models

General singleequation model

Linearunobservedeffects panelmodel

Random effectspanel model

Fixed effectspanel model

Classic linearpanel estimation

Related models

Panel modelapplication –Currencyunions andtrade

Summary

Classic linear panel estimation

• A common test in linear, unobserved effects panel datamodels is the Hausman test of random versus fixed effects.

• It essentially tests whether or not assumption 2 holds,using the usual Hausman specification test principle, whichcontrasts a consistent estimator under both the null andalternatives with an estimator that is consistent only underthe null.

• As usual, if random effects is correct, we have an efficiencygain relative to a fixed effects estimator.

• In Stata, it is implemented via estimates store andthen invoking the hausman command. See help for details.

• Note that have not considered the inclusion of laggeddependent variables. Lagged dependent variables posespecial problems in a panel, since the strict exogeneityassumption is violated. We explore this more in the nextlecture.

Lecture 06 EC6003, Quantitative Economics (15 of 23)

Page 16: Classic Static Panel Models

Economics6003

QuantitativeEconomics

John Bluedorn

Panel Data

What is paneldata?

A note onasymptotics

Linear PanelData Models

General singleequation model

Linearunobservedeffects panelmodel

Random effectspanel model

Fixed effectspanel model

Classic linearpanel estimation

Related models

Panel modelapplication –Currencyunions andtrade

Summary

Related models

• Another common classic linear panel model is the so-calledrandom coefficients specification. It takes the form:

yi ,t = β′ixi ,t + ui ,t

In Stata, such models can be estimated using xtrc orxtmixed, with the appropriate options. See Wooldridge(2001) for details.

Lecture 06 EC6003, Quantitative Economics (16 of 23)

Page 17: Classic Static Panel Models

Economics6003

QuantitativeEconomics

John Bluedorn

Panel Data

What is paneldata?

A note onasymptotics

Linear PanelData Models

General singleequation model

Linearunobservedeffects panelmodel

Random effectspanel model

Fixed effectspanel model

Classic linearpanel estimation

Related models

Panel modelapplication –Currencyunions andtrade

Summary

Currency unions and trade

• In a now famous paper, Rose (2000) presented empiricalevidence that currency union membership led to a triplingof the size of trade flows amongst member nations. Heargued that this was a causal effect.

• Interestingly, a fixed exchange rate regime with zeroexchange rate volatility does not have the same effect as acurrency union! Moving to zero exchange rate volatilitywould raise bilateral trade flows only by 2%.

• His analysis relied upon the use of the gravity model oftrade in a panel context, extended to include bilateralindicators of currency union membership. The gravitymodel uses bilateral distances and economic size to predictbilateral trade flows.

• The finding is controversial, as the size of the effect isextremely large. Let’s take a look at some of the results.

Lecture 06 EC6003, Quantitative Economics (17 of 23)

Page 18: Classic Static Panel Models

Economics6003

QuantitativeEconomics

John Bluedorn

Panel Data

What is paneldata?

A note onasymptotics

Linear PanelData Models

General singleequation model

Linearunobservedeffects panelmodel

Random effectspanel model

Fixed effectspanel model

Classic linearpanel estimation

Related models

Panel modelapplication –Currencyunions andtrade

Summary

Baseline pooled OLS results

Copyright © 2000. All rights reserved.

Lecture 06 EC6003, Quantitative Economics (18 of 23)

Page 19: Classic Static Panel Models

Economics6003

QuantitativeEconomics

John Bluedorn

Panel Data

What is paneldata?

A note onasymptotics

Linear PanelData Models

General singleequation model

Linearunobservedeffects panelmodel

Random effectspanel model

Fixed effectspanel model

Classic linearpanel estimation

Related models

Panel modelapplication –Currencyunions andtrade

Summary

Sensitivity to distance

Copyright © 2000. All rights reserved.Lecture 06 EC6003, Quantitative Economics (19 of 23)

Page 20: Classic Static Panel Models

Economics6003

QuantitativeEconomics

John Bluedorn

Panel Data

What is paneldata?

A note onasymptotics

Linear PanelData Models

General singleequation model

Linearunobservedeffects panelmodel

Random effectspanel model

Fixed effectspanel model

Classic linearpanel estimation

Related models

Panel modelapplication –Currencyunions andtrade

Summary

Sensitivity to monetary regime

Copyright © 2000. All rights reserved.

Lecture 06 EC6003, Quantitative Economics (20 of 23)

Page 21: Classic Static Panel Models

Economics6003

QuantitativeEconomics

John Bluedorn

Panel Data

What is paneldata?

A note onasymptotics

Linear PanelData Models

General singleequation model

Linearunobservedeffects panelmodel

Random effectspanel model

Fixed effectspanel model

Classic linearpanel estimation

Related models

Panel modelapplication –Currencyunions andtrade

Summary

Sensitivity to estimation (RE)

Co

pyrig

ht ©

2000. All rig

hts reserved

.

Lecture 06 EC6003, Quantitative Economics (21 of 23)

Page 22: Classic Static Panel Models

Economics6003

QuantitativeEconomics

John Bluedorn

Panel Data

What is paneldata?

A note onasymptotics

Linear PanelData Models

General singleequation model

Linearunobservedeffects panelmodel

Random effectspanel model

Fixed effectspanel model

Classic linearpanel estimation

Related models

Panel modelapplication –Currencyunions andtrade

Summary

Critiques of the Rose (2000) result

• Lockwood argued that the result is driven by the CFA andECCA, with little relevance for the Eurozone.

• Quah argued that the gravity equation plus currency unionspecification is ad hoc – the extended specification is notgrounded in theory.

• Quah also argued that the currency union sub-sample onlyaccounts for 1% of the observations (320) in the totalsample. On statistical grounds, this should be fine giventhe other assumptions.

• Many have argued that currency union membership isendogenous. Thus, assumption 1 fails.

• Subsequent work (there has been lots) has whittled thisgiant effect down. I think the consensus is probably morelike 15-20% trade creation, as opposed to 300%.

Lecture 06 EC6003, Quantitative Economics (22 of 23)

Page 23: Classic Static Panel Models

Economics6003

QuantitativeEconomics

John Bluedorn

Panel Data

What is paneldata?

A note onasymptotics

Linear PanelData Models

General singleequation model

Linearunobservedeffects panelmodel

Random effectspanel model

Fixed effectspanel model

Classic linearpanel estimation

Related models

Panel modelapplication –Currencyunions andtrade

Summary

Summary

• Unobserved effects linear panel models allow us toincorporate panel-specific, time-invariant heterogeneity inmeans/intercepts. Note that slopes are still assumed to becommon across panels.

• The random/fixed effects distinction depends uponwhether or not we feel that the observed regressors arecorrelated with the unobserved effects. If they are not,then RE is fine. Otherwise, we should use FE.

• These methods now have a long history and are commonlyused (easily implemented within Stata). However, it canbe important to use HAC-robust standard error estimationto ensure that inference is correct. Moreover, we shouldalways be wary of the strict exogeneity assumptionsrequired in these models for inference to be accurate.

Lecture 06 EC6003, Quantitative Economics (23 of 23)