0% found this document useful (0 votes)
26 views

Chapter14 Panel Data Models

The document discusses using panel data to analyze the relationship between marriage and earnings. It presents results from regressing earnings on marriage status using cross-sectional data, then discusses how panel data can help distinguish between explanations for higher earnings among married men by examining changes around the time of marriage.

Uploaded by

dgeip
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
26 views

Chapter14 Panel Data Models

The document discusses using panel data to analyze the relationship between marriage and earnings. It presents results from regressing earnings on marriage status using cross-sectional data, then discusses how panel data can help distinguish between explanations for higher earnings among married men by examining changes around the time of marriage.

Uploaded by

dgeip
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 140

Type author name/s here

Dougherty

Introduction to Econometrics,
5th edition
Chapter heading
Chapter 14: Introduction to Panel
Data Models
REGRESSION ANALYSIS WITH PANEL DATA: INTRODUCTION

A panel data set, or longitudinal data set, is one where there are
repeated observations on the same units.

1
REGRESSION ANALYSIS WITH PANEL DATA: INTRODUCTION

A panel data set, or longitudinal data set, is one where there are
repeated observations on the same units.
The units may be individuals, households, enterprises, countries, or
any set of entities that remain stable through time.

2
REGRESSION ANALYSIS WITH PANEL DATA: INTRODUCTION

A panel data set, or longitudinal data set, is one where there are
repeated observations on the same units.
The units may be individuals, households, enterprises, countries, or
any set of entities that remain stable through time.
The National Longitudinal Survey of Youth is an example. The same
respondents were interviewed every year from 1979 to 1994. Since
1994 they have been interviewed every two years.

3
REGRESSION ANALYSIS WITH PANEL DATA: INTRODUCTION

A panel data set, or longitudinal data set, is one where there are
repeated observations on the same units.
The units may be individuals, households, enterprises, countries, or
any set of entities that remain stable through time.
The National Longitudinal Survey of Youth is an example. The same
respondents were interviewed every year from 1979 to 1994. Since
1994 they have been interviewed every two years.
A balanced panel is one where every unit is surveyed in every time
period. The NLSY is unbalanced because some individuals have not
been interviewed in some years. Some could not be located, some
refused, and a few have died.

4
REGRESSION ANALYSIS WITH PANEL DATA: INTRODUCTION

Panel data sets have several advantages over cross-section data sets:
• They may make it possible to overcome a problem of bias caused
by unobserved heterogeneity.

5
REGRESSION ANALYSIS WITH PANEL DATA: INTRODUCTION

Panel data sets have several advantages over cross-section data sets:
• They may make it possible to overcome a problem of bias caused
by unobserved heterogeneity.
• They make it possible to investigate dynamics without relying on
retrospective questions that may yield data subject to measurement
error.

6
REGRESSION ANALYSIS WITH PANEL DATA: INTRODUCTION

Panel data sets have several advantages over cross-section data sets:
• They may make it possible to overcome a problem of bias caused
by unobserved heterogeneity.
• They make it possible to investigate dynamics without relying on
retrospective questions that may yield data subject to measurement
error.
• They are often very large. If there are n units and T time periods, the
potential number of observations is nT.

7
REGRESSION ANALYSIS WITH PANEL DATA: INTRODUCTION

Panel data sets have several advantages over cross-section data sets:
• They may make it possible to overcome a problem of bias caused
by unobserved heterogeneity.
• They make it possible to investigate dynamics without relying on
retrospective questions that may yield data subject to measurement
error.
• They are often very large. If there are n units and T time periods, the
potential number of observations is nT.
• Because they tend to be expensive to undertake, they are often well
designed and have high response rates. The NLSY is an example.

8
REGRESSION ANALYSIS WITH PANEL DATA: INTRODUCTION

NLSY 1988 data


Dependent variable LGEARN

OLS

MARRIED 0.129
(0.024)
SOONMARR —

SINGLE —

R2 0.271
n 1538

We will start with an example of the use of panel data to investigate simple dynamics. We
will use data from the 1988 round of the NLSY for 1,538 males in full-time employment.

9
REGRESSION ANALYSIS WITH PANEL DATA: INTRODUCTION

NLSY 1988 data


Dependent variable LGEARN

OLS

MARRIED 0.129
(0.024)
SOONMARR —

SINGLE —

R2 0.271
n 1538

Here is the result of regressing the logarithm of hourly earnings on a dummy variable for
being married and a set of control variables (years of schooling, ASVABC score, years of
tenure and square, years of work experience and square, etc; coefficients not shown).
10
REGRESSION ANALYSIS WITH PANEL DATA: INTRODUCTION

NLSY 1988 data


Dependent variable LGEARN

OLS

MARRIED 0.129
(0.024)
SOONMARR —

SINGLE —

R2 0.271
n 1538

Married males earn 12.9 percent more than single males and the effect is highly significant
(standard error in parentheses).

11
REGRESSION ANALYSIS WITH PANEL DATA: INTRODUCTION

NLSY 1988 data


Dependent variable LGEARN

OLS

MARRIED 0.129
(0.024)
SOONMARR —

SINGLE —

R2 0.271
n 1538

The effect has often been found in the literature. One explanation is that marriage entails
financial responsibilities — in particular, the raising of children — that may encourage men
to work harder or seek better paying jobs.
12
REGRESSION ANALYSIS WITH PANEL DATA: INTRODUCTION

NLSY 1988 data


Dependent variable LGEARN

OLS

MARRIED 0.129
(0.024)
SOONMARR —

SINGLE —

R2 0.271
n 1538

Another is that certain unobserved qualities that are valued by employers are also valued
by potential spouses and hence are conducive to getting married. According to this
explanation the dummy variable for being married is acting as a proxy for these qualities.
13
REGRESSION ANALYSIS WITH PANEL DATA: INTRODUCTION

NLSY 1988 data


Dependent variable LGEARN

OLS

MARRIED 0.129
(0.024)
SOONMARR —

SINGLE —

R2 0.271
n 1538

Other explanations have been proposed, but we will restrict attention to these two. With
cross-sectional data it is difficult to discriminate between them.

14
REGRESSION ANALYSIS WITH PANEL DATA: INTRODUCTION

NLSY 1988 data


Dependent variable LGEARN

OLS

MARRIED 0.129
(0.024)
SOONMARR —

SINGLE —

R2 0.271
n 1538

However with panel data one can find out whether there is an uplift at the time of marriage
or soon after, as would be predicted by the increased productivity hypothesis ...

15
REGRESSION ANALYSIS WITH PANEL DATA: INTRODUCTION

NLSY 1988 data


Dependent variable LGEARN

OLS

MARRIED 0.129
(0.024)
SOONMARR —

SINGLE —

R2 0.271
n 1538

... or whether men who end up married tend to earn more even when unmarried, as would be
predicted by the unobserved heterogeneity hypothesis.

16
REGRESSION ANALYSIS WITH PANEL DATA: INTRODUCTION

NLSY 1988 data


Dependent variable LGEARN

OLS Fixed
effects

MARRIED 0.129 0.163


(0.024) (0.028)
SOONMARR — 0.096
(0.037)
SINGLE — —

R2 0.271 0.274
n 1538 1538

We define a second dummy variable SOONMARR equal to 1 if the respondent was single in
1988 but married within the next four years. The omitted category consists of those who
were single in 1988 and still single four years later.
17
REGRESSION ANALYSIS WITH PANEL DATA: INTRODUCTION

NLSY 1988 data


Dependent variable LGEARN

OLS Fixed
effects

MARRIED 0.129 0.163


(0.024) (0.028)
SOONMARR — 0.096
(0.037)
SINGLE — —

R2 0.271 0.274
n 1538 1538

Under the null hypothesis that the marital effect is dynamic and marriage encourages men
to earn more, the coefficient of SOONMARR should be 0 because the men in this category
were still single as of 1988.
18
REGRESSION ANALYSIS WITH PANEL DATA: INTRODUCTION

NLSY 1988 data


Dependent variable LGEARN

OLS Fixed
effects

MARRIED 0.129 0.163


(0.024) (0.028)
SOONMARR — 0.096
(0.037)
SINGLE — —

R2 0.271 0.274
n 1538 1538

The t statistic is 2.60 and so it is significantly different from 0 at the 1 percent level, leading
us to reject the null hypothesis at that level.

19
REGRESSION ANALYSIS WITH PANEL DATA: INTRODUCTION

NLSY 1988 data


Dependent variable LGEARN

OLS Fixed
effects

MARRIED 0.129 0.163


(0.024) (0.028)
SOONMARR — 0.096
(0.037)
SINGLE — —

R2 0.271 0.274
n 1538 1538

However, if the alternative hypothesis is true, the coefficient of SOONMARR should be equal
to that of MARRIED, but it is lower.

20
REGRESSION ANALYSIS WITH PANEL DATA: INTRODUCTION

NLSY 1988 data


Dependent variable LGEARN

OLS Fixed Fixed


effects effects

MARRIED 0.129 0.163 —


(0.024) (0.028)
SOONMARR — 0.096 –0.066
(0.037) (0.034)
SINGLE — — –0.163
(0.028)
R2 0.271 0.274 0.274
n 1538 1538 1538

To test whether it is significantly lower, the easiest method is to change the reference
category to those who were married by 1988 and to introduce a new dummy variable
SINGLE that is equal to 1 if the respondent was still single four years later.
21
REGRESSION ANALYSIS WITH PANEL DATA: INTRODUCTION

NLSY 1988 data


Dependent variable LGEARN

OLS Fixed Fixed


effects effects

MARRIED 0.129 0.163 —


(0.024) (0.028)
SOONMARR — 0.096 –0.066
(0.037) (0.034)
SINGLE — — –0.163
(0.028)
R2 0.271 0.274 0.274
n 1538 1538 1538

The coefficient of SOONMARR now estimates the difference between the coefficients of
those married by 1988 and those married within the next four years, and if the second
hypothesis is true, it should be equal to 0.
22
REGRESSION ANALYSIS WITH PANEL DATA: INTRODUCTION

NLSY 1988 data


Dependent variable LGEARN

OLS Fixed Fixed


effects effects

MARRIED 0.129 0.163 —


(0.024) (0.028)
SOONMARR — 0.096 –0.066
(0.037) (0.034)
SINGLE — — –0.163
(0.028)
R2 0.271 0.274 0.274
n 1538 1538 1538

The t statistic is –1.93, so we (just) do not reject the second hypothesis at the 5 percent
level. The evidence is more compatible wtih the first hypothesis, but it is possible that
neither hypothesis is correct on its own and the truth might reside in some compromise.
23
REGRESSION ANALYSIS WITH PANEL DATA: INTRODUCTION

k s
Yit =  1 +   j X jit +   p Z pi +  t +  it
j=2 p =1

The starting point for a discussion of regression models using panel data is an equation of
the form shown above, where the Xj variables are observed and the Zp variables are
unobserved.
24
REGRESSION ANALYSIS WITH PANEL DATA: INTRODUCTION

k s
Yit =  1 +   j X jit +   p Z pi +  t +  it
j=2 p =1

The index i refers to the unit of observation, t refers to the time period, and j and p are used
to differentiate between different observed and unobserved explanatory variables. it is a
disturbance term assumed to satisfy the regression model assumptions.
25
REGRESSION ANALYSIS WITH PANEL DATA: INTRODUCTION

k s
Yit =  1 +   j X jit +   p Z pi +  t +  it
j=2 p =1

A trend term t has been introduced to allow for a shift of the intercept over time. If the
implicit assumption of a constant rate of change seems too strong, the trend can be
replaced by a set of dummy variables, one for each time period except the reference period.
26
REGRESSION ANALYSIS WITH PANEL DATA: INTRODUCTION

k s
Yit =  1 +   j X jit +   p Z pi +  t +  it
j=2 p =1

The Xj variables are usually the variables of interest, while the Zp variables are responsible
for unobserved heterogeneity and as such constitute a nuisance component of the model.

27
REGRESSION ANALYSIS WITH PANEL DATA: INTRODUCTION

k s
Yit =  1 +   j X jit +   p Z pi +  t +  it
j=2 p =1

Note that the unobserved heterogeneity is assumed to be unchanging and accordingly the
Zp variables do not have a time subscript.

28
REGRESSION ANALYSIS WITH PANEL DATA: INTRODUCTION

k s
Yit =  1 +   j X jit +   p Z pi +  t +  it
j=2 p =1

s
a i =   p Z pi
p =1

Because the Zp variables are unobserved, there is no means of obtaining information about
the SpZp component of the model and it is convenient to define a term ai, known as the
unobserved effect, representing the joint impact of the Zp variables on Yi.
29
REGRESSION ANALYSIS WITH PANEL DATA: INTRODUCTION

k s
Yit =  1 +   j X jit +   p Z pi +  t +  it
j=2 p =1

s
a i =   p Z pi
p =1

k
Yit =  1 +   j X jit + a i +  t +  it
j=2

Hence we can rewrite the regression model as shown. The characterization of the ai
component will be seen to be crucially important in what follows.

30
REGRESSION ANALYSIS WITH PANEL DATA: INTRODUCTION

k s
Yit =  1 +   j X jit +   p Z pi +  t +  it
j=2 p =1

s
a i =   p Z pi
p =1

k
Yit =  1 +   j X jit + a i +  t +  it
j=2

First, however, note that if the Xj controls are so comprehensive that they capture all the
relevant characteristics of the individual, there will be no relevant unobserved
characteristics.
31
REGRESSION ANALYSIS WITH PANEL DATA: INTRODUCTION

k s
Yit =  1 +   j X jit +   p Z pi +  t +  it
j=2 p =1

s
a i =   p Z pi
p =1

k
Yit =  1 +   j X jit + a i +  t +  it
j=2

In that case the ai term may be dropped and pooled OLS may be used to fit the model,
treating all the observations for all of the time periods as a single sample.

32
FIXED EFFECTS REGRESSIONS

Fixed effects estimation (within-groups method)

k
Yit =  1 +   j X jit + a i +  t +  it
j=2

The two main approaches to the fitting of models using panel data are known, for reasons
that will be explained in a moment, as fixed effects regressions, discussed in this
slideshow, and random effects regressions, discussed in a later one.
1
FIXED EFFECTS REGRESSIONS

Fixed effects estimation (within-groups method)

k
Yit =  1 +   j X jit + a i +  t +  it
j=2

Three versions of the fixed effects approach will be described. In the first two, the model is
manipulated in such a way that the unobserved effect is eliminated.

2
FIXED EFFECTS REGRESSIONS

Fixed effects estimation (within-groups method)

k
Yit =  1 +   j X jit + a i +  t +  it
j=2

k
Yi =  1 +   j X ji + a i + t +  i
j =2

In the first version, the mean values of the variables in the observations on a given
individual are calculated by averaging the observations for that individual. The unobserved
effect ai is unaffected because it is the same for all observations for that individual.
3
FIXED EFFECTS REGRESSIONS

Fixed effects estimation (within-groups method)

k
Yit =  1 +   j X jit + a i +  t +  it
j=2

k
Yi =  1 +   j X ji + a i + t +  i
j =2

Yit − Yi =   j ( X jit − X ji ) +  (t − t ) +  it −  i
k

j =2

If the second equation is subtracted from the first, the unobserved effect disappears.

4
FIXED EFFECTS REGRESSIONS

Fixed effects estimation (within-groups method)

k
Yit =  1 +   j X jit + a i +  t +  it
j=2

k
Yi =  1 +   j X ji + a i + t +  i
j =2

Yit − Yi =   j ( X jit − X ji ) +  (t − t ) +  it −  i
k

j =2

This is known as the ‘within-groups’ method because the model is explaining the variations
about the mean of the dependent variable in terms of the variations about the means of the
explanatory variables for the group of observations relating to a given individual.
5
FIXED EFFECTS REGRESSIONS

Fixed effects estimation (within-groups method)

k
Yit =  1 +   j X jit + a i +  t +  it
j=2

k
Yi =  1 +   j X ji + a i + t +  i
j =2

Yit − Yi =   j ( X jit − X ji ) +  (t − t ) +  it −  i
k

j =2

The possibility of tackling unobserved heterogeneity bias in this way is a major attraction of
panel data for researchers.

6
FIXED EFFECTS REGRESSIONS

Fixed effects estimation (within-groups method)

k
Yit =  1 +   j X jit + a i +  t +  it
j=2

k
Yi =  1 +   j X ji + a i + t +  i
j =2

Yit − Yi =   j ( X jit − X ji ) +  (t − t ) +  it −  i
k

j =2

However, there are some prices to pay. First, the intercept 1 and any X variable that
remains constant for each individual will drop out of the model.

7
FIXED EFFECTS REGRESSIONS

Fixed effects estimation (within-groups method)

k
Yit =  1 +   j X jit + a i +  t +  it
j=2

k
Yi =  1 +   j X ji + a i + t +  i
j =2

Yit − Yi =   j ( X jit − X ji ) +  (t − t ) +  it −  i
k

j =2

The elimination of the intercept may not matter, but the loss of the unchanging explanatory
variables may be frustrating.

8
FIXED EFFECTS REGRESSIONS

Fixed effects estimation (within-groups method)

k
Yit =  1 +   j X jit + a i +  t +  it
j=2

k
Yi =  1 +   j X ji + a i + t +  i
j =2

Yit − Yi =   j ( X jit − X ji ) +  (t − t ) +  it −  i
k

j =2

For example, if one is fitting an earnings function to data for a sample of individuals who
have completed their schooling, the schooling variable will disappear.

9
FIXED EFFECTS REGRESSIONS

Fixed effects estimation (within-groups method)

k
Yit =  1 +   j X jit + a i +  t +  it
j=2

k
Yi =  1 +   j X ji + a i + t +  i
j =2

Yit − Yi =   j ( X jit − X ji ) +  (t − t ) +  it −  i
k

j =2

Note that this happens even if, as would usually be the case, different individuals have
different years of schooling. For each individual, the deviation in schooling in year t from
the mean for that individual will be 0.
10
FIXED EFFECTS REGRESSIONS

Fixed effects estimation (within-groups method)

k
Yit =  1 +   j X jit + a i +  t +  it
j=2

k
Yi =  1 +   j X ji + a i + t +  i
j =2

Yit − Yi =   j ( X jit − X ji ) +  (t − t ) +  it −  i
k

j =2

Thus if the object of the exercise were to obtain an estimate of the returns to schooling
untainted by unobserved heterogeneity bias, one ends up with no estimate at all.

11
FIXED EFFECTS REGRESSIONS

Fixed effects estimation (within-groups method)

k
Yit =  1 +   j X jit + a i +  t +  it
j=2

k
Yi =  1 +   j X ji + a i + t +  i
j =2

Yit − Yi =   j ( X jit − X ji ) +  (t − t ) +  it −  i
k

j =2

A second problem with the fixed effects approach is that the dependent variables are likely
to have much smaller variances than in the original specification. Now they are measured
as deviations from the individual mean, rather than as absolute amounts.
12
FIXED EFFECTS REGRESSIONS

Fixed effects estimation (within-groups method)

k
Yit =  1 +   j X jit + a i +  t +  it
j=2

k
Yi =  1 +   j X ji + a i + t +  i
j =2

Yit − Yi =   j ( X jit − X ji ) +  (t − t ) +  it −  i
k

j =2

This is likely to have an adverse effect on the precision of the estimates of the coefficients.
It is also likely to aggravate measurement error bias if the explanatory variables are subject to
measurement error.
13
FIXED EFFECTS REGRESSIONS

Fixed effects estimation (within-groups method)

k
Yit =  1 +   j X jit + a i +  t +  it
j=2

k
Yi =  1 +   j X ji + a i + t +  i
j =2

Yit − Yi =   j ( X jit − X ji ) +  (t − t ) +  it −  i
k

j =2

A third problem is that the manipulation involves the loss of n degrees of freedom. The
reason for this will be explained later in the next slideshow.

14
FIXED EFFECTS REGRESSIONS

Fixed effects estimation (first-differences method)

k
Yit =  1 +   j X jit + a i +  t +  it
j=2

In a second version of the fixed effects approach, the first-differences method, the
unobserved effect is eliminated by subtracting the observation for the previous time period
from the observation for the current time period, for all time periods.
15
FIXED EFFECTS REGRESSIONS

Fixed effects estimation (first-differences method)

k
Yit =  1 +   j X jit + a i +  t +  it
j=2

For individual i in time period t the model may be written as shown.

16
FIXED EFFECTS REGRESSIONS

Fixed effects estimation (first-differences method)

k
Yit =  1 +   j X jit + a i +  t +  it
j=2

k
Yit −1 =  1 +   j X jit −1 + a i +  (t − 1) +  it −1
j=2

For the previous time period, the relationship is given by the second equation.

17
FIXED EFFECTS REGRESSIONS

Fixed effects estimation (first-differences method)

k
Yit =  1 +   j X jit + a i +  t +  it
j=2

k
Yit −1 =  1 +   j X jit −1 + a i +  (t − 1) +  it −1
j=2

Yit − Yit −1 =   j ( X jit − X jit −1 ) +  +  it −  it −1


k

j=2

k
Yit =   j X jit +  +  it −  it −1
j =2

Subtracting the second equation from the first, one obtains the third, rewritten as the fourth,
and again the unobserved heterogeneity has disappeared.

18
FIXED EFFECTS REGRESSIONS

Fixed effects estimation (first-differences method)

k
Yit =  1 +   j X jit + a i +  t +  it
j=2

k
Yit −1 =  1 +   j X jit −1 + a i +  (t − 1) +  it −1
j=2

Yit − Yit −1 =   j ( X jit − X jit −1 ) +  +  it −  it −1


k

j=2

k
Yit =   j X jit +  +  it −  it −1
j =2

Note that the error term is now (it – it–1). Its previous value was (it-1 – it–2). Thus the
differencing gives rise to moving average autocorrelation if it satisfies the regression
model assumptions.
19
FIXED EFFECTS REGRESSIONS

Fixed effects estimation (first-differences method)

k
Yit =  1 +   j X jit + a i +  t +  it
j=2

k
Yit −1 =  1 +   j X jit −1 + a i +  (t − 1) +  it −1
j=2
 it = r it −1 + vit

Yit − Yit −1 =   j ( X −( 1+−r )−it −1


1 = v it) +
k
it − −it −X
jit jit −1 it it −1

 vit if r is close to 1
j=2

k
Yit =   j X jit +  +  it −  it −1
j =2

However, if it is subject to AR(1) autocorrelation and r is close to 1, taking first differences
may approximately solve the problem.

20
FIXED EFFECTS REGRESSIONS: LSDV METHOD

k
Yit =  1 +   j X jit +  t + a i +  it
j=2

k n
Yit =   j X jit +  t +  a i Ai +  it
j=2 i =1

In the third version of the fixed effects approach, known as the least squares dummy
variable (LSDV) method, the unobserved effect is brought explicitly into the model.

1
FIXED EFFECTS REGRESSIONS: LSDV METHOD

k
Yit =  1 +   j X jit +  t + a i +  it
j=2

k n
Yit =   j X jit +  t +  a i Ai +  it
j=2 i =1

If we define a set of dummy variables Ai, where Ai is equal to 1 in the case of an observation
relating to individual i and 0 otherwise, the model can be rewritten as shown.

2
FIXED EFFECTS REGRESSIONS: LSDV METHOD

Individual Time period A1 A2 A3 A4


1 1 1 0 0 0
1 2 1 0 0 0
1 3 1 0 0 0
2 1 0 1 0 0
2 2 0 1 0 0
2 3 0 1 0 0
3 1 0 0 1 0
3 2 0 0 1 0
3 3 0 0 1 0
4 1 0 0 0 1
4 2 0 0 0 1
4 3 0 0 0 1

As an illustration, if one had a (very small) panel data set with 4 individuals and 3 time
periods, with the observations ordered by individual and then time period, the dummy
variables would be as shown.
3
FIXED EFFECTS REGRESSIONS: LSDV METHOD

k
Yit =  1 +   j X jit +  t + a i +  it
j=2

k n
Yit =   j X jit +  t +  a i Ai +  it
j=2 i =1

Formally, the unobserved effect is now being treated as the coefficient of the individual-
specific dummy variable, the aiAi term representing a fixed effect on the dependent variable
Yi for individual i (this accounts for the name given to the fixed effects approach).
4
FIXED EFFECTS REGRESSIONS: LSDV METHOD

k
Yit =  1 +   j X jit +  t + a i +  it
j=2

k n
Yit =   j X jit +  t +  a i Ai +  it
j=2 i =1

Having re-specified the model in this way, it can be fitted using OLS.

5
FIXED EFFECTS REGRESSIONS: LSDV METHOD

k
Yit =  1 +   j X jit +  t + a i +  it
j=2

k n
Yit =   j X jit +  t +  a i Ai +  it
j=2 i =1

Note that if we include a dummy variable for every individual in the sample as well as an
intercept, we will fall into the dummy variable trap.

6
FIXED EFFECTS REGRESSIONS: LSDV METHOD

k
Yit =  1 +   j X jit +  t + a i +  it
j=2

k n
Yit =   j X jit +  t +  a i Ai +  it
j=2 i =1

To avoid this, we can define one individual to be the reference category, so that 1 is its
intercept, and then treat the ai as the shifts in the intercept for the other individuals.

7
FIXED EFFECTS REGRESSIONS: LSDV METHOD

k
Yit =  1 +   j X jit +  t + a i +  it
j=2

k n
Yit =   j X jit +  t +  a i Ai +  it
j=2 i =1

However, the choice of reference category is often arbitrary and accordingly the
interpretation of the ai not particularly illuminating.

8
FIXED EFFECTS REGRESSIONS: LSDV METHOD

k
Yit =  1 +   j X jit +  t + a i +  it
j=2

k n
Yit =   j X jit +  t +  a i Ai +  it
j=2 i =1

Alternatively, we can drop the 1 intercept and define dummy variables for all of the
individuals, as has been done here. The ai now become the intercepts for each of the
individuals.
9
FIXED EFFECTS REGRESSIONS: LSDV METHOD

k
Yit =  1 +   j X jit +  t + a i +  it
j=2

k n
Yit =   j X jit +  t +  a i Ai +  it
j=2 i =1

Note that, in common with the first two versions of the fixed effects approach, the LSDV
method requires panel data.

10
FIXED EFFECTS REGRESSIONS: LSDV METHOD

k
Yit =  1 +   j X jit +  t + a i +  it
j=2

k n
Yit =   j X jit +  t +  a i Ai +  it
j=2 i =1

With cross-sectional data, one would be defining a dummy variable for every observation,
exhausting the degrees of freedom. The dummy variables on their own would give a perfect
but meaningless fit.
11
FIXED EFFECTS REGRESSIONS: LSDV METHOD

k
Yit =  1 +   j X jit +  t + a i +  it
j=2

k n
Yit =   j X jit +  t +  a i Ai +  it
j=2 i =1

If there are a large number of individuals, using the LSDV method directly is not a practical
proposition, given the need for a large number of dummy variables.

12
FIXED EFFECTS REGRESSIONS: LSDV METHOD

k
Yit =  1 +   j X jit +  t + a i +  it
j=2

k n
Yit =   j X jit +  t +  a i Ai +  it
j=2 i =1

Equivalent to within-groups method:

Yit − Yi =   j ( X jit − X ji ) +  ( t − t ) +  it −  i
k

j=2

However, it can be shown mathematically that the approach is equivalent to the within-
groups method and therefore yields precisely the same estimates.

13
FIXED EFFECTS REGRESSIONS: LSDV METHOD

k
Yit =  1 +   j X jit +  t + a i +  it
j=2

k n
Yit =   j X jit +  t +  a i Ai +  it
j=2 i =1

Equivalent to within-groups method:

Yit − Yi =   j ( X jit − X ji ) +  ( t − t ) +  it −  i
k

j=2

Thus in practice we always use the within-groups method rather than the LSDV method.
But it may be useful to know that the within-groups method is equivalent to modelling the
fixed effects with dummy variables.
14
FIXED EFFECTS REGRESSIONS: LSDV METHOD

k
Yit =  1 +   j X jit +  t + a i +  it
j=2

k n
Yit =   j X jit +  t +  a i Ai +  it
j=2 i =1

Equivalent to within-groups method:

Yit − Yi =   j ( X jit − X ji ) +  ( t − t ) +  it −  i
k

j=2

The only apparent difference between the LSDV and within-groups methods is in the
number of degrees of freedom. It is easy to see from the LSDV specification that there are
nT – k – n degrees of freedom if the panel is balanced.
15
FIXED EFFECTS REGRESSIONS: LSDV METHOD

k
Yit =  1 +   j X jit +  t + a i +  it
j=2

k n
Yit =   j X jit +  t +  a i Ai +  it
j=2 i =1

Equivalent to within-groups method:

Yit − Yi =   j ( X jit − X ji ) +  ( t − t ) +  it −  i
k

j=2

In the within-groups approach, it seemed at first that there were nT – k. However n degrees
of freedom are consumed in the manipulation that eliminate the ai, so the number of
degrees of freedom is really nT – k – n.
16
RANDOM EFFECTS REGRESSIONS

k s
Yit =  1 +   j X jit +   p Z pi +  t +  it
j=2 p =1

k
Yit =  1 +   j X jit + a i +  t +  it
j=2
k
=  1 +   j X jit +  t + uit
j=2

When the observed variables of interest are constant for each individual, a fixed effects
regression is not an effective tool because such variables cannot be included.

1
RANDOM EFFECTS REGRESSIONS

k s
Yit =  1 +   j X jit +   p Z pi +  t +  it
j=2 p =1

k
Yit =  1 +   j X jit + a i +  t +  it
j=2
k
=  1 +   j X jit +  t + uit
j=2

In this section, we will consider an alternative approach, known as a random effects


regression that may, subject to two conditions, provide a solution to this problem.

2
RANDOM EFFECTS REGRESSIONS

k s
Yit =  1 +   j X jit +   p Z pi +  t +  it
j=2 p =1

k
Yit =  1 +   j X jit + a i +  t +  it
j=2
k
=  1 +   j X jit +  t + uit
j=2

The first condition is that it is possible to treat each of the unobserved Zp variables as being
drawn randomly from a given distribution.

3
RANDOM EFFECTS REGRESSIONS

k s
Yit =  1 +   j X jit +   p Z pi +  t +  it
j=2 p =1

k
Yit =  1 +   j X jit + a i +  t +  it
j=2
k
=  1 +   j X jit +  t + uit uit = a i +  it
j=2

If this is the case, the ai may be treated as random variables (hence the name of this
approach) drawn from a given distribution and we may rewrite the model as shown.

4
RANDOM EFFECTS REGRESSIONS

k s
Yit =  1 +   j X jit +   p Z pi +  t +  it
j=2 p =1

k
Yit =  1 +   j X jit + a i +  t +  it
j=2
k
=  1 +   j X jit +  t + uit uit = a i +  it
j=2

We have dealt with the unobserved effect by subsuming it into a compound disturbance
term uit.

5
RANDOM EFFECTS REGRESSIONS

k s
Yit =  1 +   j X jit +   p Z pi +  t +  it
j=2 p =1

k
Yit =  1 +   j X jit + a i +  t +  it
j=2
k
=  1 +   j X jit +  t + uit uit = a i +  it
j=2

The second condition is that the Zp variables are distributed independently of all of the Xj
variables.

6
RANDOM EFFECTS REGRESSIONS

k s
Yit =  1 +   j X jit +   p Z pi +  t +  it
j=2 p =1

k
Yit =  1 +   j X jit + a i +  t +  it
j=2
k
=  1 +   j X jit +  t + uit uit = a i +  it
j=2

If this is not the case, a, and hence u, will not be uncorrelated with the Xj variables and the
random effects estimation will be biased and inconsistent. We would have to use fixed
effects estimation instead, even if the first condition seems to be satisfied.
7
RANDOM EFFECTS REGRESSIONS

k s
Yit =  1 +   j X jit +   p Z pi +  t +  it
j=2 p =1

k
Yit =  1 +   j X jit + a i +  t +  it
j=2
k
=  1 +   j X jit +  t + uit uit = a i +  it
j=2

If the two conditions are satisfied, we may use this as our regression specification, but
there is a complication. uit will be subject to a special form of autocorrelation and we will
have to use an estimation technique that takes account of it.
8
RANDOM EFFECTS REGRESSIONS

k s
Yit =  1 +   j X jit +   p Z pi +  t +  it
j=2 p =1

k
Yit =  1 +   j X jit + a i +  t +  it
j=2
k
=  1 +   j X jit +  t + uit uit = a i +  it
j=2

E (uit ) = E (a i +  it ) = E (a i ) + E ( it ) = 0

First, we will check the other regression model assumptions. Given our assumption that it
satisfies the assumptions, we can see that uit satisfies the assumption of zero expected
value.
9
RANDOM EFFECTS REGRESSIONS

k s
Yit =  1 +   j X jit +   p Z pi +  t +  it
j=2 p =1

k
Yit =  1 +   j X jit + a i +  t +  it
j=2
k
=  1 +   j X jit +  t + uit uit = a i +  it
j=2

E (uit ) = E (a i +  it ) = E (a i ) + E ( it ) = 0

Here we are assuming without loss of generality that E(ai) = 0, any nonzero component
being absorbed by the intercept, 1.

10
RANDOM EFFECTS REGRESSIONS

k s
Yit =  1 +   j X jit +   p Z pi +  t +  it
j=2 p =1

k
Yit =  1 +   j X jit + a i +  t +  it
j=2
k
=  1 +   j X jit +  t + uit uit = a i +  it
j=2

E (uit ) = E (a i +  it ) = E (a i ) + E ( it ) = 0

 u2 =  a2 + =  a2 +  2 + 2 a , =  a2 +  2
it i it i it i it

uit will satisfy the condition that it should have constant variance. Its variance is equal to
the sum of the variances of ai and it. (The covariance between ai and it is 0 on the
assumption that ai is distributed independently of it.)
11
RANDOM EFFECTS REGRESSIONS

k s
Yit =  1 +   j X jit +   p Z pi +  t +  it
j=2 p =1

k
Yit =  1 +   j X jit + a i +  t +  it
j=2
k
=  1 +   j X jit +  t + uit uit = a i +  it
j=2

E (uit ) = E (a i +  it ) = E (a i ) + E ( it ) = 0

 u2 =  a2 + =  a2 +  2 + 2 a , =  a2 +  2
it i it i it i it

uit will also be distributed independently of the values of Xj, since both ai and it are
assumed to satisfy this condition.

12
RANDOM EFFECTS REGRESSIONS

k
Yit =  1 +   j X jit +  t + uit uit = a i +  it
j=2

However there is a problem with the assumption that its value in any observation be
generated independently of its value in all other observations.

13
RANDOM EFFECTS REGRESSIONS

k
Yit =  1 +   j X jit +  t + uit uit = a i +  it
j=2

Individual Time u

1 1 a1 + 11
1 2 a1 + 12
1 3 a1 + 13
2 1 a2 + 21
2 2 a2 + 22
2 3 a2 + 23

For all the observations relating to a given individual, ai will have the same value, reflecting
the unchanging unobserved characteristics of the individual.

14
RANDOM EFFECTS REGRESSIONS

k
Yit =  1 +   j X jit +  t + uit uit = a i +  it
j=2

Individual Time u

1 1 a1 + 11
1 2 a1 + 12
1 3 a1 + 13
2 1 a2 + 21
2 2 a2 + 22
2 3 a2 + 23

This is illustrated in the table above, which shows the disturbance terms for the first two
individuals in a data set, assuming that there are three time periods.

15
RANDOM EFFECTS REGRESSIONS

k
Yit =  1 +   j X jit +  t + uit uit = a i +  it
j=2

Individual Time u

1 1 a1 + 11
1 2 a1 + 12
1 3 a1 + 13
2 1 a2 + 21
2 2 a2 + 22
2 3 a2 + 23

The disturbance terms for individual 1 are independent of those for individual 2 because a1
amd a2 are generated independently. However the disturbance terms for the observations
relating to individual 1 are correlated because they contain the common component a1.
16
RANDOM EFFECTS REGRESSIONS

k
Yit =  1 +   j X jit +  t + uit uit = a i +  it
j=2

Individual Time u

1 1 a1 + 11
1 2 a1 + 12
1 3 a1 + 13
2 1 a2 + 21
2 2 a2 + 22
2 3 a2 + 23

The same is true for the observations relating to individual 2, and for all other individuals in
the sample.

17
RANDOM EFFECTS REGRESSIONS

k
Yit =  1 +   j X jit +  t + uit uit = a i +  it
j=2

Individual Time u

1 1 a1 + 11
1 2 a1 + 12
1 3 a1 + 13
2 1 a2 + 21
2 2 a2 + 22
2 3 a2 + 23

 u u =  (a +
it it ' i it )(a i + it ' ) =  a ia i +  a i it ' +   ita i +   it it ' =  a2

The covariance of the disturbance terms in periods t and t' for individual i is decomposed
above. The terms involving  are all 0 because  is assumed to be generated completely
randomly. However the first term is not 0. It is the population variance of a.
18
RANDOM EFFECTS REGRESSIONS

k
Yit =  1 +   j X jit +  t + uit uit = a i +  it
j=2

Individual Time u

1 1 a1 + 11
1 2 a1 + 12
1 3 a1 + 13
2 1 a2 + 21
2 2 a2 + 22
2 3 a2 + 23

 u u =  (a +
it it ' i it )(a i + it ' ) =  a ia i +  a i it ' +   ita i +   it it ' =  a2

OLS remains unbiased and consistent, despite the violation of the regression model
assumption, but it is inefficient because it is possible to derive estimators with smaller
variances. In addition, the standard errors are computed wrongly.
19
RANDOM EFFECTS REGRESSIONS

k
Yit =  1 +   j X jit +  t + uit uit = a i +  it
j=2

Individual Time u

1 1 a1 + 11
1 2 a1 + 12
1 3 a1 + 13
2 1 a2 + 21
2 2 a2 + 22
2 3 a2 + 23

 u u =  (a +
it it ' i it )(a i + it ' ) =  a ia i +  a i it ' +   ita i +   it it ' =  a2

We have encountered a problem of the violation of this regression model assumption once
before, in the case of autocorrelated disturbance terms in a time series model.

20
RANDOM EFFECTS REGRESSIONS

k
Yit =  1 +   j X jit +  t + uit uit = a i +  it
j=2

Individual Time u

1 1 a1 + 11
1 2 a1 + 12
1 3 a1 + 13
2 1 a2 + 21
2 2 a2 + 22
2 3 a2 + 23

 u u =  (a +
it it ' i it )(a i + it ' ) =  a ia i +  a i it ' +   ita i +   it it ' =  a2

The solution then was to transform the model so that the transformed disturbance term
satisfied the regression model assumption, and a similar procedure is adopted in the
present case.
21
RANDOM EFFECTS REGRESSIONS

k
Yit =  1 +   j X jit +  t + uit uit = a i +  it
j=2

Individual Time u

1 1 a1 + 11
1 2 a1 + 12
1 3 a1 + 13
2 1 a2 + 21
2 2 a2 + 22
2 3 a2 + 23

 u u =  (a +
it it ' i it )(a i + it ' ) =  a ia i +  a i it ' +   ita i +   it it ' =  a2

However, while the transformation in the case of autocorrelation was very straightforward,
in the present case it is more complex and will not be discussed further here. Nevertheless
it is easy to fit a random effects model using regression applications such as Stata.
22
RANDOM EFFECTS REGRESSIONS

k
Yit =  1 +   j X jit +  t + uit uit = a i +  it
j=2

Individual Time u

1 1 a1 + 11
1 2 a1 + 12
1 3 a1 + 13
2 1 a2 + 21
2 2 a2 + 22
2 3 a2 + 23

 u u =  (a +
it it ' i it )(a i + it ' ) =  a ia i +  a i it ' +   ita i +   it it ' =  a2

Random effects estimation uses a procedure known as feasible generalized least squares.
It yields consistent estimates of the coefficients and therefore depends on n being
sufficiently large. For small n its properties are unknown.
23
RANDOM EFFECTS REGRESSIONS

NLSY 1980–1996
Dependent variable LGEARN

OLS Fixed Random


effects effects

MARRIED 0.184 0.106 0.134


(0.007) (0.012) (0.010)
SOONMARR 0.096 0.045 0.060
(0.009) (0.010) (0.009)
SINGLE — — —

R2 0.358 0.268 0.346


n 20,343 20.343 20.343

The table shows the results of performing random effects regressions as well as OLS and
fixed effects regressions. In the next slideshow we consider how we should choose the
appropriate estimation approach.
24
FIXED EFFECTS OR RANDOM EFFECTS?

NLSY 1980–1996
Dependent variable LGEARN

OLS Fixed Random


effects effects

MARRIED 0.184 0.106 0.134


(0.007) (0.012) (0.010)
SOONMARR 0.096 0.045 0.060
(0.009) (0.010) (0.009)
SINGLE — — —
R2 0.358 0.268 0.346
DWH test — — 306.2
n 20,343 20.343 20.343

When should you use fixed effects estimation rather than random effects estimation, or vice
versa?

1
FIXED EFFECTS OR RANDOM EFFECTS?

NLSY 1980–1996
Dependent variable LGEARN

OLS Fixed Random


effects effects

MARRIED 0.184 0.106 0.134


(0.007) (0.012) (0.010)
SOONMARR 0.096 0.045 0.060
(0.009) (0.010) (0.009)
SINGLE — — —
R2 0.358 0.268 0.346
DWH test — — 306.2
n 20,343 20.343 20.343

In principle random effects is more attractive because observed characteristics that remain
constant for each individual are retained in the regression model. In fixed effects
estimation, they have to be dropped.
2
FIXED EFFECTS OR RANDOM EFFECTS?

NLSY 1980–1996
Dependent variable LGEARN

OLS Fixed Random


effects effects

MARRIED 0.184 0.106 0.134


(0.007) (0.012) (0.010)
SOONMARR 0.096 0.045 0.060
(0.009) (0.010) (0.009)
SINGLE — — —
R2 0.358 0.268 0.346
DWH test — — 306.2
n 20,343 20.343 20.343

Also with random effects estimation we do not lose n degrees of freedom, as is the case
with fixed effects.

3
FIXED EFFECTS OR RANDOM EFFECTS?

NLSY 1980–1996
Dependent variable LGEARN

OLS Fixed Random


effects effects

MARRIED 0.184 0.106 0.134


(0.007) (0.012) (0.010)
SOONMARR 0.096 0.045 0.060
(0.009) (0.010) (0.009)
SINGLE — — —
R2 0.358 0.268 0.346
DWH test — — 306.2
n 20,343 20.343 20.343

However if either of the preconditions for using random effects is violated, we should use
fixed effects instead.

4
FIXED EFFECTS OR RANDOM EFFECTS?

NLSY 1980–1996
Dependent variable LGEARN

OLS Fixed Random


effects effects

MARRIED 0.184 0.106 0.134


(0.007) (0.012) (0.010)
SOONMARR 0.096 0.045 0.060
(0.009) (0.010) (0.009)
SINGLE — — —
R2 0.358 0.268 0.346
DWH test — — 306.2
n 20,343 20.343 20.343

One precondition is that the observations can be described as being drawn randomly from
a given population. This is a reasonable assumption in the case of the NLSY because it was
designed to be a random sample.
5
FIXED EFFECTS OR RANDOM EFFECTS?

NLSY 1980–1996
Dependent variable LGEARN

OLS Fixed Random


effects effects

MARRIED 0.184 0.106 0.134


(0.007) (0.012) (0.010)
SOONMARR 0.096 0.045 0.060
(0.009) (0.010) (0.009)
SINGLE — — —
R2 0.358 0.268 0.346
DWH test — — 306.2
n 20,343 20.343 20.343

By contrast, it would not be a reasonable assumption if the units of observation in the panel
data set were countries and the sample consisted of those countries that are members of
the Organization for Economic Cooperation and Development (OECD).
6
FIXED EFFECTS OR RANDOM EFFECTS?

NLSY 1980–1996
Dependent variable LGEARN

OLS Fixed Random


effects effects

MARRIED 0.184 0.106 0.134


(0.007) (0.012) (0.010)
SOONMARR 0.096 0.045 0.060
(0.009) (0.010) (0.009)
SINGLE — — —
R2 0.358 0.268 0.346
DWH test — — 306.2
n 20,343 20.343 20.343

These countries certainly cannot be considered to represent a random sample of the 200-
odd sovereign states in the world.

7
FIXED EFFECTS OR RANDOM EFFECTS?

NLSY 1980–1996
Dependent variable LGEARN

OLS Fixed Random


effects effects

MARRIED 0.184 0.106 0.134


(0.007) (0.012) (0.010)
SOONMARR 0.096 0.045 0.060
(0.009) (0.010) (0.009)
SINGLE — — —
R2 0.358 0.268 0.346
DWH test — — 306.2
n 20,343 20.343 20.343

The other precondition is that the unobserved effect be distributed independently of the Xj
variables. How can we tell if this is the case?

8
FIXED EFFECTS OR RANDOM EFFECTS?

NLSY 1980–1996
Dependent variable LGEARN

OLS Fixed Random


effects effects

MARRIED 0.184 0.106 0.134


(0.007) (0.012) (0.010)
SOONMARR 0.096 0.045 0.060
(0.009) (0.010) (0.009)
SINGLE — — —
R2 0.358 0.268 0.346
DWH test — — 306.2
n 20,343 20.343 20.343

The standard procedure is yet another implementation of the Durbin–Wu–Hausman test


used to help us choose between OLS and IV estimation in models where there is suspected
measurement error or simultaneous equations endogeneity.
9
FIXED EFFECTS OR RANDOM EFFECTS?

NLSY 1980–1996
Dependent variable LGEARN

OLS Fixed Random


effects effects

MARRIED 0.184 0.106 0.134


(0.007) (0.012) (0.010)
SOONMARR 0.096 0.045 0.060
(0.009) (0.010) (0.009)
SINGLE — — —
R2 0.358 0.268 0.346
DWH test — — 306.2
n 20,343 20.343 20.343

The null hypothesis is that the ai are distributed independently of the Xj.

10
FIXED EFFECTS OR RANDOM EFFECTS?

NLSY 1980–1996
Dependent variable LGEARN

OLS Fixed Random


effects effects

MARRIED 0.184 0.106 0.134


(0.007) (0.012) (0.010)
SOONMARR 0.096 0.045 0.060
(0.009) (0.010) (0.009)
SINGLE — — —
R2 0.358 0.268 0.346
DWH test — — 306.2
n 20,343 20.343 20.343

If this is correct, both random effects and fixed effects are consistent, but fixed effects will
be inefficient because, looking at it in its LSDV form, it involves estimating an unnecessary
set of dummy variable coefficients.
11
FIXED EFFECTS OR RANDOM EFFECTS?

NLSY 1980–1996
Dependent variable LGEARN

OLS Fixed Random


effects effects

MARRIED 0.184 0.106 0.134


(0.007) (0.012) (0.010)
SOONMARR 0.096 0.045 0.060
(0.009) (0.010) (0.009)
SINGLE — — —
R2 0.358 0.268 0.346
DWH test — — 306.2
n 20,343 20.343 20.343

If the null hypothesis is false, the random effects estimates will be subject to unobserved
heterogeneity bias and will therefore differ systematically from the fixed effects estimates.

12
FIXED EFFECTS OR RANDOM EFFECTS?

NLSY 1980–1996
Dependent variable LGEARN

OLS Fixed Random


effects effects

MARRIED 0.184 0.106 0.134


(0.007) (0.012) (0.010)
SOONMARR 0.096 0.045 0.060
(0.009) (0.010) (0.009)
SINGLE — — —
R2 0.358 0.268 0.346
DWH test — — 306.2
n 20,343 20.343 20.343

As in its other applications, the DWH test determines whether the estimates of the
coefficients, taken as a group, are significantly different in the two regressions.

13
FIXED EFFECTS OR RANDOM EFFECTS?

NLSY 1980–1996
Dependent variable LGEARN

OLS Fixed Random


effects effects

MARRIED 0.184 0.106 0.134


(0.007) (0.012) (0.010)
SOONMARR 0.096 0.045 0.060
(0.009) (0.010) (0.009)
SINGLE — — —
R2 0.358 0.268 0.346
DWH test — — 306.2
n 20,343 20.343 20.343

If any variables are dropped in the fixed effects regression, they are excluded from the test.
Under the null hypothesis the test statistic has a chi-squared distribution.

14
FIXED EFFECTS OR RANDOM EFFECTS?

NLSY 1980–1996
Dependent variable LGEARN

OLS Fixed Random


effects effects

MARRIED 0.184 0.106 0.134


(0.007) (0.012) (0.010)
SOONMARR 0.096 0.045 0.060
(0.009) (0.010) (0.009)
SINGLE — — —
R2 0.358 0.268 0.346
DWH test — — 306.2
n 20,343 20.343 20.343

In principle this should have degrees of freedom equal to the number of slope coefficients
being compared, but for technical reasons that require matrix algebra for an explanation,
the actual number may be lower.
15
FIXED EFFECTS OR RANDOM EFFECTS?

NLSY 1980–1996
Dependent variable LGEARN

OLS Fixed Random


effects effects

MARRIED 0.184 0.106 0.134


(0.007) (0.012) (0.010)
SOONMARR 0.096 0.045 0.060
(0.009) (0.010) (0.009)
SINGLE — — —
R2 0.358 0.268 0.346
DWH test — — 306.2
n 20,343 20.343 20.343

A regression application that implements the test, such as Stata, should determine the
actual number of degrees of freedom.

16
FIXED EFFECTS OR RANDOM EFFECTS?

NLSY 1980–1996
Dependent variable LGEARN

OLS Fixed Random


effects effects

MARRIED 0.184 0.106 0.134


(0.007) (0.012) (0.010)
SOONMARR 0.096 0.045 0.060
(0.009) (0.010) (0.009)
SINGLE — — —
R2 0.358 0.268 0.346
DWH test — — 306.2
n 20,343 20.343 20.343

We will perform the test for the marriage-effect-on-earnings example. The fixed effects
estimates, using the within-groups approach, of the coefficients of married men and soon-
to-be married men are 0.106 and 0.045, respectively.
17
FIXED EFFECTS OR RANDOM EFFECTS?

NLSY 1980–1996
Dependent variable LGEARN

OLS Fixed Random


effects effects

MARRIED 0.184 0.106 0.134


(0.007) (0.012) (0.010)
SOONMARR 0.096 0.045 0.060
(0.009) (0.010) (0.009)
SINGLE — — —
R2 0.358 0.268 0.346
DWH test — — 306.2
n 20,343 20.343 20.343

The corresponding random effects estimates are considerably higher, 0.134 and 0.060,
inviting the suspicion that they may be inflated by unobserved heterogeneity.

18
FIXED EFFECTS OR RANDOM EFFECTS?

NLSY 1980–1996
Dependent variable LGEARN

OLS Fixed Random


effects effects

MARRIED 0.184 0.106 0.134


(0.007) (0.012) (0.010)
SOONMARR 0.096 0.045 0.060
(0.009) (0.010) (0.009)
SINGLE — — —
R2 0.358 0.268 0.346
DWH test — — 306.2
n 20,343 20.343 20.343

The DWH test involves the comparison of 13 coefficients (those of MARRIED, SOONMARR,
and 11 controls). The test statistic is 306.2.

19
FIXED EFFECTS OR RANDOM EFFECTS?

NLSY 1980–1996
Dependent variable LGEARN

OLS Fixed Random


effects effects

MARRIED 0.184 0.106 0.134


(0.007) (0.012) (0.010)
SOONMARR 0.096 0.045 0.060

 (13 )crit, 0.1% = 34.5


(0.009) (0.010) 2 (0.009)

SINGLE — — —
R2 0.358 0.268 0.346
DWH test — — 306.2
n 20,343 20.343 20.343

With 13 degrees of freedom the critical value of chi-squared at the 0.1 percent level is 34.5,
so we definitely conclude that we should be using fixed effects estimation.

20
FIXED EFFECTS OR RANDOM EFFECTS?

Random effects estimation

k s
Yit =  1 +   j X jit +   p Z pi +  t +  it
j=2 p =1

k
Yit =  1 +   j X jit + a i +  t +  it
j=2
k
=  1 +   j X jit +  t + uit uit = a i +  it
j=2

Suppose that the DWH test indicates that we can use random effects rather than fixed
effects.

21
FIXED EFFECTS OR RANDOM EFFECTS?

Random effects estimation

k s
Yit =  1 +   j X jit +   p Z pi +  t +  it
j=2 p =1

k
Yit =  1 +   j X jit + a i +  t +  it
j=2
k
=  1 +   j X jit +  t + uit uit = a i +  it
j=2

We should then consider whether there are any unobserved effects at all. It is just possible
that the model has been so well specified that the disturbance term u consists of only the
purely random component it and there is no individual-specific ai term.
22
FIXED EFFECTS OR RANDOM EFFECTS?

Random effects estimation

k s
Yit =  1 +   j X jit +   p Z pi +  t +  it
j=2 p =1

k
Yit =  1 +   j X jit + a i +  t +  it
j=2
k
=  1 +   j X jit +  t + uit uit = a i +  it
j=2

OLS

k
Yit =  1 +   j X jit +  t +  it if a i = 0
j=2

In this situation we should use pooled OLS, with two advantages. There is a gain in
efficiency because we are not attempting to allow for non-existent within-groups
autocorrelation.
23
FIXED EFFECTS OR RANDOM EFFECTS?

Random effects estimation

k s
Yit =  1 +   j X jit +   p Z pi +  t +  it
j=2 p =1

k
Yit =  1 +   j X jit + a i +  t +  it
j=2
k
=  1 +   j X jit +  t + uit uit = a i +  it
j=2

OLS

k
Yit =  1 +   j X jit +  t +  it if a i = 0
j=2

In addition we will be able to take advantage of the finite-sample properties of OLS, instead
of having to rely on the asymptotic properties of random effects.

24
FIXED EFFECTS OR RANDOM EFFECTS?

Random effects estimation

k s
Yit =  1 +   j X jit +   p Z pi +  t +  it
j=2 p =1

k
Yit =  1 +   j X jit + a i +  t +  it
j=2
k
=  1 +   j X jit +  t + uit uit = a i +  it
j=2

OLS

k
Yit =  1 +   j X jit +  t +  it if a i = 0
j=2

Various tests have been developed to detect the presence of random effects.

25
FIXED EFFECTS OR RANDOM EFFECTS?

Random effects estimation

k s
Yit =  1 +   j X jit +   p Z pi +  t +  it
j=2 p =1

k
Yit =  1 +   j X jit + a i +  t +  it
j=2
k
=  1 +   j X jit +  t + uit uit = a i +  it
j=2

OLS

k
Yit =  1 +   j X jit +  t +  it if a i = 0
j=2

The most common, implemented in some regression applications, is the Breusch–Pagan


lagrange multiplier test, the test statistic having a chi-squared distribution with one degree
of freedom under the null hypothesis of no random effects.
26
FIXED EFFECTS OR RANDOM EFFECTS?

Random effects estimation

k s
Yit =  1 +   j X jit +   p Z pi +  t +  it
j=2 p =1

k
Yit =  1 +   j X jit + a i +  t +  it
j=2
k
=  1 +   j X jit +  t + uit uit = a i +  it
j=2

OLS Breusch–Pagan statistic (2(1) under H0) = 20,007


k
Yit =  1 +   j X jit +  t +  it if a i = 0
j=2

In the case of the marriage effect example the statistic is very high indeed, 20,007, but in
this case it is meaningless because are not able to use random effects estimation.

27
FIXED EFFECTS OR RANDOM EFFECTS?

Random effects estimation

k s
Yit =  1 +   j X jit +   p Z pi +  t +  it
j=2 p =1

k
Yit =  1 +   j X jit + a i +  t +  it
j=2
k
=  1 +   j X jit +  t + uit uit = a i +  it
j=2

OLS

k
Yit =  1 +   j X jit +  t +  it if a i = 0
j=2

A note on the random effects and fixed effects terminology. It is generally agreed that
random effects/fixed effects terminology can be misleading, but that it is too late to change
it now.
28
FIXED EFFECTS OR RANDOM EFFECTS?

Random effects estimation

k s
Yit =  1 +   j X jit +   p Z pi +  t +  it
j=2 p =1

k
Yit =  1 +   j X jit + a i +  t +  it
j=2
k
=  1 +   j X jit +  t + uit uit = a i +  it
j=2

OLS

k
Yit =  1 +   j X jit +  t +  it if a i = 0
j=2

It is natural to think that random effects estimation should be used when the unobserved
effect can be characterized as being drawn randomly from a given population and that fixed
effects should be used when the unobserved effect is non-random.
29
FIXED EFFECTS OR RANDOM EFFECTS?

k s
Yit =  1 +   j X jit +   p Z pi +  t +  it
j=2 p =1

k
Yit =  1 +   j X jit + a i +  t +  it
j=2
k
=  1 +   j X jit +  t + uit uit = a i +  it
j=2

OLS

k
Yit =  1 +   j X jit +  t +  it if a i = 0
j=2

The second part of that statement is correct. However the first part is correct only if the
unobserved effect is distributed independently of the Xj variables. If it is not, fixed effects
should be used instead to avoid the problem of unobserved heterogeneity bias.
30
FIXED EFFECTS OR RANDOM EFFECTS?

Can the observations be described as being a


random sample from a given population?

Yes No

Perform both fixed Use fixed effects


effects and random
effects regressions.

Does a DWH test indicate No Provisionally choose random


significant differences in effects. Does a test indicate the
the coefficients? presence of random effects?

Yes Yes No
Use fixed effects Use random Use pooled
effects OLS

The diagram summarizes the decision-making procedure. Make sure that you understand
the reasons for making the choices.

31
DIFFERENCES IN DIFFERENCES

NLSY 1979–, NLSY 1997– data sets


Mean hourly earnings 1995 and 2011 (at 2011 prices)

1995 2011 Change

Female 17.306 17.672 0.366

Male 20.073 20.043 ‒0.030

Difference ‒2.767 ‒2.371 0.396

We will illustrate the use of the approach with an example. In the United States, as in other
countries, there has long been legislation intended to eradicate pay discrimination against
women. How much effect has this had in practice?
3
DIFFERENCES IN DIFFERENCES

NLSY 1979–, NLSY 1997– data sets


Mean hourly earnings 1995 and 2011 (at 2011 prices)

1995 2011 Change

Female 17.306 17.672 0.366

Male 20.073 20.043 ‒0.030

Difference ‒2.767 ‒2.371 0.396

We will investigate this issue using data from the Differences-in-differences data set (see
Appendix B). This consists of data on earnings and personal characteristics for samples of
young adults in their late twenties and early thirties for two years, 1995 and 2011.
4
DIFFERENCES IN DIFFERENCES

NLSY 1979–, NLSY 1997– data sets


Mean hourly earnings 1995 and 2011 (at 2011 prices)

1995 2011 Change

Female 17.306 17.672 0.366

Male 20.073 20.043 ‒0.030

Difference ‒2.767 ‒2.371 0.396

The 1995 data are drawn from the NLSY1979– data set, and the 2011 data from the
NLSY1997– data set. The earnings data for 1995 have been adjusted to 2011 prices using
the Bureau of Labor Statistics Consumer Price Index.
5
DIFFERENCES IN DIFFERENCES

NLSY 1979–, NLSY 1997– data sets


Mean hourly earnings 1995 and 2011 (at 2011 prices)

1995 2011 Change

Female 17.306 17.672 0.366

Male 20.073 20.043 ‒0.030

Difference ‒2.767 ‒2.371 0.396

In 1995, mean female hourly earnings were $17.306. In 2011, they were $17.672, a gain of
$0.37. Only part of this change is attributable to the effect of the legislation. The general
level of earnings will have changed over the 16-year interval and we must allow for that.
6
DIFFERENCES IN DIFFERENCES

NLSY 1979–, NLSY 1997– data sets


Mean hourly earnings 1995 and 2011 (at 2011 prices)

1995 2011 Change

Female 17.306 17.672 0.366

Male 20.073 20.043 ‒0.030

Difference ‒2.767 ‒2.371 0.396

One way to do this is to examine, not how the level of female earnings has changed, but
how the difference between female and male earnings has changed. We will assume that, in
the absence of the legislation, female and male earnings would have had similar trends.
7
DIFFERENCES IN DIFFERENCES

NLSY 1979–, NLSY 1997– data sets


Mean hourly earnings 1995 and 2011 (at 2011 prices)

1995 2011 Change

Female 17.306 17.672 0.366

Male 20.073 20.043 ‒0.030

Difference ‒2.767 ‒2.371 0.396

The table presents hourly earnings in the two years for the two cross-sections. In the 1995
cross-section, the hourly earnings of females were $2.77 lower than those of males. In 2011,
they were $2.37 lower.
8
DIFFERENCES IN DIFFERENCES

NLSY 1979–, NLSY 1997– data sets


Mean hourly earnings 1995 and 2011 (at 2011 prices)

1995 2011 Change

Female 17.306 17.672 0.366

Male 20.073 20.043 ‒0.030

Difference ‒2.767 ‒2.371 0.396

Thus the differences-in-differences estimate of the impact of the legislation and associated
measures is an improvement of $0.40 in female hourly earnings.

9
DIFFERENCES IN DIFFERENCES

NLSY 1979–, NLSY 1997– data sets


Mean hourly earnings 1995 and 2011 (at 2011 prices)

1995 2011 Change

Female 17.306 17.672 0.366

Male 20.073 20.043 ‒0.030

Difference ‒2.767 ‒2.371 0.396

In this instance, the differences-in-differences estimate is little different from the raw
estimate, but that is only because the level of earnings was remarkably static over the
interval.
10
DIFFERENCES IN DIFFERENCES

Dependent variable hourly earnings

(1)

D 0.37
(0.51)
MALE 2.77
(0.52)
DMALE ‒0.40
(0.69)
S —

constant 17.31
(0.39)
R2 0.014
n 3,954

Is the effect significant? To answer this, we regress earnings on a dummy variable MALE, a
second dummy variable D defined to be 0 for 1995 and 1 for 2011, and an interactive term
DMALE defined to be the product of D and MALE. The result is shown in column 1.
11
DIFFERENCES IN DIFFERENCES

Dependent variable hourly earnings

(1)

D 0.37
(0.51)
MALE 2.77
(0.52)
DMALE ‒0.40
(0.69)
S —

constant 17.31
(0.39)
R2 0.014
n 3,954

The coefficient of MALE estimates the difference in male and female earnings in 1995, and
the coefficient of DMALE the difference in the difference. The coefficient is not significant at
the 5 percent level. This is hardly surprising, given the low estimate of the effect.
12
FIXED EFFECTS OR RANDOM EFFECTS?

Dependent variable hourly earnings

(1)

D 0.37
(0.51)
MALE 2.77
(0.52)
DMALE ‒0.40
(0.69)
S —

constant 17.31
(0.39)
R2 0.014
n 3,954

The validity of the differences-in-differences estimate depends on all other relevant factors
remaining unchanged, or of having no impact on the effect. But this may not be the case.

13
FIXED EFFECTS OR RANDOM EFFECTS?

Dependent variable hourly earnings

(1)

D 0.37
(0.51)
MALE 2.77
(0.52)
DMALE ‒0.40
(0.69)
S —

constant 17.31
(0.39)
R2 0.014
n 3,954

Females in the United States have long had more schooling, on average, than males, and
the differential increased from 1995 to 2011. In the 1995 sample, mean schooling was 13.53
years for females and 13.33 for males. In 2011, 15.04 years for females and 14.14 for males.
14
FIXED EFFECTS OR RANDOM EFFECTS?

Dependent variable hourly earnings

(1) (2)

D 0.37 ‒1.74
(0.51) (0.49)
MALE 2.77 3.06
(0.52) (0.49)
DMALE ‒0.40 0.57
(0.69) (0.65)
S — 1.40
(0.06)
constant 17.31 ‒1.61
(0.39) (0.92)
R2 0.014 0.126
n 3,954 3,954

What happens if one controls for schooling? We add schooling to the specification (column
2). The coefficient of DMALE now suggests that the male-female earnings differential actually
increased over the interval, controlling for schooling, but again the estimate is not significant.
15
FIXED EFFECTS OR RANDOM EFFECTS?

Dependent variable hourly earnings

(1) (2)

D 0.37 ‒1.74
(0.51) (0.49)
MALE 2.77 3.06
(0.52) (0.49)
DMALE ‒0.40 0.57
(0.69) (0.65)
S — 1.40
(0.06)
constant 17.31 ‒1.61
(0.39) (0.92)
R2 0.014 0.126
n 3,954 3,954

This is only the starting point. We should at least control for years of work experience,
systematically different for males and females, and perhaps other characteristics. We might
also wish to explore whether there are interactive effects.
16
FIXED EFFECTS OR RANDOM EFFECTS?

Dependent variable hourly earnings

(1) (2)

D 0.37 ‒1.74
(0.51) (0.49)
MALE 2.77 3.06
(0.52) (0.49)
DMALE ‒0.40 0.57
(0.69) (0.65)
S — 1.40
(0.06)
constant 17.31 ‒1.61
(0.39) (0.92)
R2 0.014 0.126
n 3,954 3,954

Is the impact of schooling on earnings the same for males and females, and has it changed
over the interval?

17
FIXED EFFECTS OR RANDOM EFFECTS?

Dependent variable hourly earnings

(1) (2)

D 0.37 ‒1.74
(0.51) (0.49)
MALE 2.77 3.06
(0.52) (0.49)
DMALE ‒0.40 0.57
(0.69) (0.65)
S — 1.40
(0.06)
constant 17.31 ‒1.61
(0.39) (0.92)
R2 0.014 0.126
n 3,954 3,954

The differences-in-differences approach started out as a simple computation, but its


implementation may require a complex regression model with much scope for the use of
dummy variables and interactive terms.
18

You might also like