19
Introduction Unbalanced Panel Data Models Unbalanced Panels with Stata Unbalanced Panel Data Models Baltagi Textbook - Chapter 9 Markus Mayer Department of Economics University of Vienna June XX, 2010 Presented by Markus Mayer Unbalanced Panel Data Models

Unbalanced Panel Data Models - homepage.univie.ac.at · Introduction Unbalanced Panel Data Models Unbalanced Panels with Stata Balanced vs. Unbalanced Panel In a balanced panel, the

Embed Size (px)

Citation preview

Page 1: Unbalanced Panel Data Models - homepage.univie.ac.at · Introduction Unbalanced Panel Data Models Unbalanced Panels with Stata Balanced vs. Unbalanced Panel In a balanced panel, the

IntroductionUnbalanced Panel Data ModelsUnbalanced Panels with Stata

Unbalanced Panel Data ModelsBaltagi Textbook - Chapter 9

Markus Mayer

Department of EconomicsUniversity of Vienna

June XX, 2010

Presented by Markus Mayer Unbalanced Panel Data Models

Page 2: Unbalanced Panel Data Models - homepage.univie.ac.at · Introduction Unbalanced Panel Data Models Unbalanced Panels with Stata Balanced vs. Unbalanced Panel In a balanced panel, the

IntroductionUnbalanced Panel Data ModelsUnbalanced Panels with Stata

Agenda

1 Introduction

2 Unbalanced Panel Data ModelsThe Unbalanced One-Way Error Component ModelThe Unbalanced Two-Way Error Component ModelTesting for Individual and Time EffectsThe Unbalanced Nested Error Component Model

3 Unbalanced Panels with Stata

Presented by Markus Mayer Unbalanced Panel Data Models

Page 3: Unbalanced Panel Data Models - homepage.univie.ac.at · Introduction Unbalanced Panel Data Models Unbalanced Panels with Stata Balanced vs. Unbalanced Panel In a balanced panel, the

IntroductionUnbalanced Panel Data ModelsUnbalanced Panels with Stata

Balanced vs. Unbalanced Panel

In a balanced panel, the number of time periods T is thesame for all individuals i . Otherwise we are dealing with anunbalanced panel.

Most introductory texts restrict themselves to balancedpanels, despite the fact, that unbalanced panels are the norm.

For example, in large panel data sets like the SOEP, there arealways some individuals, who drop out of the sample.

The reason for the absence of data is important. We have tomake a distinction between randomly missing data andnonrandomly missing data.

Presented by Markus Mayer Unbalanced Panel Data Models

Page 4: Unbalanced Panel Data Models - homepage.univie.ac.at · Introduction Unbalanced Panel Data Models Unbalanced Panels with Stata Balanced vs. Unbalanced Panel In a balanced panel, the

IntroductionUnbalanced Panel Data ModelsUnbalanced Panels with Stata

Illustration

i t earnings married

1 2007 35.000 yes1 2008 39.000 yes1 2009 40.000 yes2 2007 46.000 no2 2008 48.000 no2 2009 51.000 no

Balanced Panel

i t earnings married

1 2008 39.000 yes1 2009 40.000 yes2 2007 46.000 no2 2008 48.000 no2 2009 51.000 no

Unbalanced Panel

Presented by Markus Mayer Unbalanced Panel Data Models

Page 5: Unbalanced Panel Data Models - homepage.univie.ac.at · Introduction Unbalanced Panel Data Models Unbalanced Panels with Stata Balanced vs. Unbalanced Panel In a balanced panel, the

IntroductionUnbalanced Panel Data ModelsUnbalanced Panels with Stata

One-Way Error Component ModelTwo-Way Error Component ModelTesting for Individual and Time EffectsNested Error Component Model

One-Way Error Component Model 1/5

Model for 2 cross-sections and unequal number of time-seriesobservations n1 and n2.(

y1

y2

)=

(X1

X2

)β +

(u1

u2

)In this case, the variance-covariance matrix is given by

Ω =

σ2ν In1 + σ2

µJn1n1 0 00 σ2

ν In1 + σ2µJn1n1 σ2

µJn1n2

0 σ2µJn2n1 σ2

ν In2 + σ2µJn2n2

Presented by Markus Mayer Unbalanced Panel Data Models

Page 6: Unbalanced Panel Data Models - homepage.univie.ac.at · Introduction Unbalanced Panel Data Models Unbalanced Panels with Stata Balanced vs. Unbalanced Panel In a balanced panel, the

IntroductionUnbalanced Panel Data ModelsUnbalanced Panels with Stata

One-Way Error Component ModelTwo-Way Error Component ModelTesting for Individual and Time EffectsNested Error Component Model

One-Way Error Component Model 2/5

General form of regression model:yit = α + X ′

itβ + uit

uit = µi + νit

i = 1, ...,N; t = 1, ...,Ti

and in vector notation y = Zδ + u.

the OLS of the unbalanced data is given byδOLS = (Z ′Z )−1Z ′y .

OLS is BLUE, if the variance component σ2µ is equal to zero.

If it is positive, OLS is still unbiased and consistent, but itsstandard errors are biased.

Presented by Markus Mayer Unbalanced Panel Data Models

Page 7: Unbalanced Panel Data Models - homepage.univie.ac.at · Introduction Unbalanced Panel Data Models Unbalanced Panels with Stata Balanced vs. Unbalanced Panel In a balanced panel, the

IntroductionUnbalanced Panel Data ModelsUnbalanced Panels with Stata

One-Way Error Component ModelTwo-Way Error Component ModelTesting for Individual and Time EffectsNested Error Component Model

One-Way Error Component Model 3/5

Methods for estimating the variance components:

For balanced model, ANOVA estimators are best quadraticunbiased estimators (BQU) of the variance component. Forunbalanced one-way model, BQU estimators of the variancecomponents are a function of the variance components itself,we loose desired properties except unbiasedness.

MLE are functions of sufficient statistics and consistent andasymptotically efficient, but it does not take into account theloss of degrees of freedom due to the regression coefficients inestimating the variance components.

Presented by Markus Mayer Unbalanced Panel Data Models

Page 8: Unbalanced Panel Data Models - homepage.univie.ac.at · Introduction Unbalanced Panel Data Models Unbalanced Panels with Stata Balanced vs. Unbalanced Panel In a balanced panel, the

IntroductionUnbalanced Panel Data ModelsUnbalanced Panels with Stata

One-Way Error Component ModelTwo-Way Error Component ModelTesting for Individual and Time EffectsNested Error Component Model

One-Way Error Component Model 4/5

Under normality of disturbances, MINQUE and MIVQUEprocedures for estimating the variance components areidentical, therefore we focus on MIVQUE. It is a linearcombination of the variance components, pµσ2

µ + pνσν2. Itrequires a priori values of the variance components. Theestimator has only minimum variance properties, if the a priorivaues are the true values. We therefore call the MIVQUE’locally best’ or ’locally minimum variance’.

Presented by Markus Mayer Unbalanced Panel Data Models

Page 9: Unbalanced Panel Data Models - homepage.univie.ac.at · Introduction Unbalanced Panel Data Models Unbalanced Panels with Stata Balanced vs. Unbalanced Panel In a balanced panel, the

IntroductionUnbalanced Panel Data ModelsUnbalanced Panels with Stata

One-Way Error Component ModelTwo-Way Error Component ModelTesting for Individual and Time EffectsNested Error Component Model

One-Way Error Component Model 5/5

Comparison of estimators by using Monte Carlo simulations:

For the estimation of the regression coefficients, ANOVA-typefeasible GLS estimators compare well with the morecomplicated estimators like ML.

For the estimation of the variance remainder component σ2ν ,

the estimation methods show no big difference.

Similarily to the balanced case, better estimates of thevariance components do not imply better estimates of theregression coefficients.

Extracting a balanced panel out of an unbalanced panel leadsto an enormous loss in efficiency.

Presented by Markus Mayer Unbalanced Panel Data Models

Page 10: Unbalanced Panel Data Models - homepage.univie.ac.at · Introduction Unbalanced Panel Data Models Unbalanced Panels with Stata Balanced vs. Unbalanced Panel In a balanced panel, the

IntroductionUnbalanced Panel Data ModelsUnbalanced Panels with Stata

One-Way Error Component ModelTwo-Way Error Component ModelTesting for Individual and Time EffectsNested Error Component Model

Two-Way Error Component Model 1/3

Regression model with unbalanced two-way error componentdisturbances:

yit = X ′itβ + uit

i = 1, ...,Nt ; t = 1, ...,Tuit = µi + λt + νit

where Nt is the number of individuals observed in t and Dt aNt × N matrix obtained from IN by omitting the rowscorresponding to individuals not observed in t.

Presented by Markus Mayer Unbalanced Panel Data Models

Page 11: Unbalanced Panel Data Models - homepage.univie.ac.at · Introduction Unbalanced Panel Data Models Unbalanced Panels with Stata Balanced vs. Unbalanced Panel In a balanced panel, the

IntroductionUnbalanced Panel Data ModelsUnbalanced Panels with Stata

One-Way Error Component ModelTwo-Way Error Component ModelTesting for Individual and Time EffectsNested Error Component Model

Two-Way Error Component Model 2/3

This way, we can construct the matrix ∆ gives thedummy-variable structure for the incomplete data model.

∆ =

D1 D1lN...

. . .

DT DTlN

Presented by Markus Mayer Unbalanced Panel Data Models

Page 12: Unbalanced Panel Data Models - homepage.univie.ac.at · Introduction Unbalanced Panel Data Models Unbalanced Panels with Stata Balanced vs. Unbalanced Panel In a balanced panel, the

IntroductionUnbalanced Panel Data ModelsUnbalanced Panels with Stata

One-Way Error Component ModelTwo-Way Error Component ModelTesting for Individual and Time EffectsNested Error Component Model

Two-Way Error Component Model 3/3

Fixed Effects Model: For fixed µi and t , we have to run theabove regression with the matrix of dummies. This will oftenbe infeasible for large panels. The Within transformation is abit more complicated for the two-way case, than for theone-way case.

Random Effects Model: Using vector notation, the incompletetwo-way random effects model is given as u = ∆1µ+∆2λ+ ν.An ANOVA-type quadratic unbiased estimator (QUE) of thevariance components based on the Within residuals leads tounbiased σ2

ν , even for random effects specifcation.

Presented by Markus Mayer Unbalanced Panel Data Models

Page 13: Unbalanced Panel Data Models - homepage.univie.ac.at · Introduction Unbalanced Panel Data Models Unbalanced Panels with Stata Balanced vs. Unbalanced Panel In a balanced panel, the

IntroductionUnbalanced Panel Data ModelsUnbalanced Panels with Stata

One-Way Error Component ModelTwo-Way Error Component ModelTesting for Individual and Time EffectsNested Error Component Model

Testing for Individual and Time Effects

We employ the LM test for the unbalanced two-way errorcomponent model

The LM statistic is asymptotically distributed as 22 under the

null hypotheses.

The statistic can easily computed using least squares residuals.

The variance component cannot be negative, thereforeH0 : σ2

µ = 0 and H1 : σ2µ > 0.

Presented by Markus Mayer Unbalanced Panel Data Models

Page 14: Unbalanced Panel Data Models - homepage.univie.ac.at · Introduction Unbalanced Panel Data Models Unbalanced Panels with Stata Balanced vs. Unbalanced Panel In a balanced panel, the

IntroductionUnbalanced Panel Data ModelsUnbalanced Panels with Stata

One-Way Error Component ModelTwo-Way Error Component ModelTesting for Individual and Time EffectsNested Error Component Model

Nested Error Component Model 1/3

For this model, an unbalanced panel leads to natural nestedgrouping.

Example: In a study about Europe, the countries are theprimary group and the provinces the nested group.

The unbalanced panel data regression model is given byyijt = x ′ijtβ + uijt

i = 1, ...M; j = 1, ...,Ni ; t = 1, ...,Ti

where the i th component describes the nested group.

Presented by Markus Mayer Unbalanced Panel Data Models

Page 15: Unbalanced Panel Data Models - homepage.univie.ac.at · Introduction Unbalanced Panel Data Models Unbalanced Panels with Stata Balanced vs. Unbalanced Panel In a balanced panel, the

IntroductionUnbalanced Panel Data ModelsUnbalanced Panels with Stata

One-Way Error Component ModelTwo-Way Error Component ModelTesting for Individual and Time EffectsNested Error Component Model

Nested Error Component Model 2/3

The disturbances are given byuijt = µi + νij + εijti = 1, ...,M; j = 1, ...,Ni ; t = 1, ...,Ti

where µi denotes the i th unobservable province-specific effectand νij denotes the nested effect of the j th individual and εijtdenotes the remainder disturbance. The components areindependent of each other and among themselves.

This model allows for an unequal number of individuals ineach province as well as different number of observed timeperiods across provinces.

Presented by Markus Mayer Unbalanced Panel Data Models

Page 16: Unbalanced Panel Data Models - homepage.univie.ac.at · Introduction Unbalanced Panel Data Models Unbalanced Panels with Stata Balanced vs. Unbalanced Panel In a balanced panel, the

IntroductionUnbalanced Panel Data ModelsUnbalanced Panels with Stata

One-Way Error Component ModelTwo-Way Error Component ModelTesting for Individual and Time EffectsNested Error Component Model

Nested Error Component Model 3/3

ANOVA, MIVQUE and MLE can be used to estimate thismodel.

The performance of these estimation strategies can becompared by employing Monte Carlo simulations.

MLE and MIVQUE are best for estimating the variancecomponents and standard errors of the coefficients.

ANOVA are equally successful for estimating the coefficients.

Presented by Markus Mayer Unbalanced Panel Data Models

Page 17: Unbalanced Panel Data Models - homepage.univie.ac.at · Introduction Unbalanced Panel Data Models Unbalanced Panels with Stata Balanced vs. Unbalanced Panel In a balanced panel, the

IntroductionUnbalanced Panel Data ModelsUnbalanced Panels with Stata

Unbalanced Panels with Stata 1/2

In the case of randomly missing data, most Stata commandscan be applied to unbalanced panels without causinginconsistency of the estimators.

Before working with panel data, it is adviseable to search forthe Stata commands in the internet, if there is a specialprocedure for unbalanced panels.

Stata can provide us with the information, to which extendthe panel is unbalanced. Once the panel is xtset, thextdescribe command gives us the following output:

Presented by Markus Mayer Unbalanced Panel Data Models

Page 18: Unbalanced Panel Data Models - homepage.univie.ac.at · Introduction Unbalanced Panel Data Models Unbalanced Panels with Stata Balanced vs. Unbalanced Panel In a balanced panel, the

IntroductionUnbalanced Panel Data ModelsUnbalanced Panels with Stata

Unbalanced Panels with Stata 2/2

Figure: Stata output of an unbalanced panel.

Presented by Markus Mayer Unbalanced Panel Data Models

Page 19: Unbalanced Panel Data Models - homepage.univie.ac.at · Introduction Unbalanced Panel Data Models Unbalanced Panels with Stata Balanced vs. Unbalanced Panel In a balanced panel, the

References

References

Baltagi, B. H., (2005): Econometric Analysis of PanelData. John Wiley & Sons, Chichester, England.

Cameron, A. C., and P. K., Trivedi (2009):Microeconometrics Using Stata. Stata Press, College Station,Texas.

Presented by Markus Mayer Unbalanced Panel Data Models