Limited Dependent Variables in Econometrics
Limited Dependent Variables in Econometrics
Simon Quinn*
Hilary 2013
These notes provide some background for six lectures that I will be giving this year for the [Link]
Econometrics core course. I will use slides for the lectures themselves. I will make the slides
available online after our last lecture. It is likely that there will be some things in these notes that
we do not have time to cover in class, and we may cover some things in class that are not cov-
ered in these notes. Though we will focus in class on the most important issues, please consider
all of the lectures and all of these notes to be potentially relevant for the exam (except where noted).
For each lecture, I have ‘starred’ (‘?’) references to Cameron and Trivedi (2005) and to Wooldridge
(2002 and 2010). You are required to read at least one of these, but you do not need to read more.
I have also provided other references; you are not required or expected to read these.
* Department of Economics, Centre for the Study of African Economies and St Antony’s College, University of
Oxford: [Link]@[Link]. I must particularly thank Victoria Prowse for her assistance
in preparing these lectures. I must also thank Cameron Chisholm, Cosmina Dorobantu, Sebastian Königs, Julien
Labonne and Jeremy Magruder for very useful comments. All errors remain my own.
1
Lectures
We will spend six lectures on limited dependent variables; the following table summarises.
H ILARY
Problem sets
There are two problem sets for limited dependent variables. Both were written by Victoria Prowse,
and have evolved on this course over several years. The problem sets do not attempt to cover
every aspect of our lectures, but they will provide a very useful opportunity for you to consider key
concepts and techniques.
• We will not be discussing the specific details of any numerical optimisation techniques.
(Therefore, for example, you may disregard Question 7(ii)(c) on the June 2011 Exam.)
• We will discuss the Generalised Ordered Probit (and Generalised Ordered Logit), which
were not covered prior to 2012.
2 [Link]@[Link]
Are any of these notes not examinable?
There are a few small aspects of these notes that are not examinable for any question on limited
dependent variables:
• I provide some example Stata code; you do not need to know any Stata code for any exam
questions about limited dependent variables.
• I briefly discuss nonparametric and semiparametric estimation in a few places; you do not
need to know anything about these estimation techniques for any exam questions about lim-
ited dependent variables.
• You do not need to be able to repeat the derivation in equations 4.13 to 4.24.
Nonethelesss, I include this extra material because I think it may be useful to help your general
understanding of the other themes that we will discuss.
3 [Link]@[Link]
1 Lecture 1: Binary Choice I
Required readings (for Lectures 1 and 2):
• ? C AMERON , A.C. AND T RIVEDI , P.K. (2005): Microeconometrics: Methods and Appli-
cations. Cambridge University Press, pages 463 – 478 (i.e. sections 14.1 to 14.4, inclusive)
or
• ? W OOLDRIDGE , J. (2002): Econometric Analysis of Cross Section and Panel Data. The
MIT Press, pages 453 – 461 (i.e. sections 15.1 to 15.4, inclusive)
or
• ? W OOLDRIDGE , J. (2010): Econometric Analysis of Cross Section and Panel Data (2nd
ed.). The MIT Press, pages 561 – 569 (i.e. sections 15.1 to 15.4, inclusive).
Other references:
• T RAIN , K. (2009): Discrete Choice Methods with Simulation. Cambridge University Press.
We shall consider this question using data from Tanzania’s 2005/2006 Integrated Labour Force
Survey (‘ILFS’). For simplicity, we will consider a single explanatory variable: the year in which
a respondent was born. We index individuals by i, and denote the ith individual’s year of birth as
xi . We record educational attainment by a dummy variable, yi , defined such that:
0 if the ith individual did not complete primary education;
yi = (1.1)
1 if the ith individual did complete primary education.
(Note immediately that — as with all binary outcome models — this denomination is arbitrary:
for example, we could just as easily reverse the assignment of 0 and 1 without changing anything
of the structure of the problem.)
Figure 1.1 illustrates the data: it shows the education dummy variable on the y axis (with data
points ‘jittered’, for illustrative clarity), and the age variable on the x axis. Note that we will limit
consideration to individuals born between 1920 and 1980 (inclusive).
4 [Link]@[Link]
1.2 A simple model of binary choice
Pr(yi = 1 | xi ). (1.2)
That is, we will build and estimate a model of the probability of attaining a primary school educa-
tion, conditional upon year of birth.
As with most econometric outcome variables, investment in primary school education is a matter
of choice. We therefore begin by specifying a (very simple) microeconomic model of investment
in education. Denote the ith household’s utility of attending primary school as UiS (xi ) and the
utility of not attending school (i.e. ‘staying home’) as UiH (xi ). For simplicity, we will assume that
each utility function is additive in the year in which a child was born:1
5 [Link]@[Link]
1.3 The probit model
You will be familiar with the normal distribution, and with the concepts of the probability density
and the cumulative density. Recall that the probability density function φ(x) is:
2
1 x
φ(x) = √ · exp − , (1.9)
2π 2
and that the cumulative density function (Φ(x)) has no closed-form expression:
Z x
Φ(x) = φ(z) dz. (1.10)
−∞
Figure 1.2 illustrates. With our distributional assumption, we can now write the conditional prob-
ability of primary education:2
Pr(yi = 1 | xi ; β0 , β1 ) = Pr(β0 + β1 xi + εi ≥ 0 | xi ) (1.11)
= Pr(−εi ≤ β0 + β1 xi | xi ) (1.12)
= Pr(εi ≤ β0 + β1 xi | xi ) (1.13)
= Φ(β0 + β1 xi ) (1.14)
∴ Pr(yi = 0 | xi ; β0 , β1 ) = 1 − Φ(β0 + β1 xi ). (1.15)
2
Note that equation 1.13 follows from equation 1.12 because, under the assumption of normality, the distribution of
ε is symmetric.
6 [Link]@[Link]
1.3 The probit model
Figure 1.2: The standard normal: probability density (φ(·)) and cumulative density (Φ(·))
φ()
Φ(a) .
....
........
φ(b)
...... ...... .. ....
...... .. ....
...... .. .....
. ... ... .
......
...... ................................ .....
...... ...... ...... ....
.. ... .. ..... ..... ..
.
..
. .
. ..
.
...... .. ..... ...
...... ..... .... ..... ....
...... .........
.
.. .. .. ......... ...
...
.....
..... ....
..............
.....
Equation 1.14 (and, equivalently, equation 1.15) defines the ‘probit model’. There is certainly no
need to motivate the probit model with an additive random utility approach, as we have done;
indeed, the vast majority of empirical papers (and econometrics textbooks) start merely with some
equivalent to equation 1.14. But the additive random utility approach is useful (i) for thinking about
how microeconomic models may motivate econometric analysis, (ii) for explaining the ‘latent
variable interpretation’ of the probit model, and (iii) to lay the conceptual groundwork for other
limited depdenent variable models that we will discuss later (in particular, models of multinomial
choice). Train (2009, page 14) explains the utility-based approach in discrete choice models as
follows:
7 [Link]@[Link]
1.4 Estimation by maximum likelihood
Denoting the stacked values of yi and xi as y and x respectively, we can write the likelihood for a
sample of N individuals as:
N
X
`(β0 , β1 ; y | x) = {yi · ln Φ(β0 + β1 xi ) + (1 − yi ) · ln [1 − Φ(β0 + β1 xi )]} . (1.19)
i=1
You will be aware that several numerical algorithms may be used to find the values (β̂0 , β̂1 ) that
jointly maximise this log-likelihood — for example, the Newton-Raphson method, the Berndt-
Hall-Hall-Hausman algorithm, the Davidson-Fletcher-Powell algorithm, the Broyden-Fletcher-
Goldfarb-Shanno algorithm, etc. Happily, Stata (and other statistical packages) has these algo-
rithms built in, so we can use these algorithms without having to code them ourselves.
that is, the log-likelihood is the log of the conditional probability density (or probability mass) of
y, given X, for some parameter value β. This can formally be described as the conditional log-
likelihood function, but we usually just term it ‘the log-likelihood’.4 Further, you will recall that, if
3
However, this is certainly not the only way we could estimate the probit model. For example, equation 1.14 implies
that E(yi | xi ) = Φ(β0 + β1 xi ); the model could therefore also be estimated by Nonlinear Least Squares (i.e. a
method-of-moments estimator).
4
Cameron and Trivedi (page 139) note that ignoring the marginal likelihood of X is not a problem “if f (y | X) and
f (X) depend on mutually exclusive sets of parameters”; that is, if there is no endogeneity problem.
8 [Link]@[Link]
1.4 Estimation by maximum likelihood
we assume observations are independent across individuals, we can decompose the log-likelihood
as:
N
X N
X
`(β; y | X) = `i (β; yi | xi ) = ln f (yi | xi ; β). (1.21)
i=1 i=1
where the lefthand side of this expression is called the ‘score vector’.
You will recall further that all maximum likelihood estimators share at least four important prop-
erties:
(i) Consistency: In general terms, an estimator is consistent if, as the number of observations
becomes very large, the probability of the estimator missing the true parameter value goes
to zero. Suppose that we are trying to estimate some true scalar parameter β, and that we
are using a maximum likelihood estimator β̂M L , with N observations in our sample. Then
consistency means that, for any ε > 0,
We can describe this by saying “β̂M L converges in probability to the true value β”, and we
can write
(ii) Asymptotic normality: Assuming some regularity conditions, the asymptotic distribution
of a maximum likelihood estimator is normal:5
√
d
N · β̂ − β → N 0, I(β)−1 ,
(1.25)
2
∂ `i (β; yi | xi )
where I(β) = −E . (1.26)
∂β∂β 0
5
See, for example, page 392 of Wooldridge (2002) for those conditions. In this context, the conditions are: (i) that β
is interior to the set of possible values for β, and (ii) that the log-likelihood is twice continuously differentiable on
the interior of that set. We will not need to worry about these conditions in these lectures.
9 [Link]@[Link]
1.4 Estimation by maximum likelihood
An alternative approach is to use the ‘outer product of the gradient’ (sometimes known as
the ‘BHHH estimate’, or just the ‘OPG’):
N
ˆ 1 X ∂`i (β) ∂`i (β)
IOP G (β̂M L ) = · . (1.28)
N i=1 ∂β ∂β 0
β=β̂M L
As Gould et al explain, “the OPG has the same asymptotic properties as [I( ˆ β̂)−1 ], the ‘con-
ventional variance estimator”’ (page 11).6 One advantage of the OPG is that it does not
require calculation of the second derivatives of the log-likelihood; if we are maximising
our log-likelihood with an algorithm that does not itself require those second derivatives (for
example, the BHHH method), the OPG method may therefore be computationally more con-
venient (see, for example, Gould et al, pages 11–12).
(iii) Efficiency: Equations 1.25 and 1.26 show that, asymptotically, the variance of maximum
likelihood estimators is the ‘Cramér-Rao lower bound’ (i.e. the inverse of the Fisher in-
formation matrix). That is, maximum likelihood estimators are efficient: the asymptotic
variance of the maximum likelihood estimator is at least as small as the variance of any
other consistent estimator of the parameter.
10 [Link]@[Link]
1.4 Estimation by maximum likelihood
where `(β̂) is the value of the maximised log-likelihood, and `0 is the log-likelihood for a model
without explanatory variables (so, in the context of our probit model, `0 is the log-likelihood for a
probit estimation using Pr(yi = 1 | x) = Φ(β0 )). You should confirm that we will always obtain
Rp2 ∈ (0, 1).
Additionally, in a binary outcome model, we may wish to report the ‘percent correctly predicted’.
Wooldridge (2002, page 465) explains:
For each i, we compute the predicted probability that yi = 1, given the explanatory
variables, xi . If [Φ(β̂0 +β̂1 xi ) > 0.5], we predict yi to be unity; if [Φ(β̂0 +β̂1 xi ) ≤ 0.5],
yi is predicted to be zero. The percentage of times the predicted yi matches the actual
yi is the percent correctly predicted. In many cases it is easy to predict one of the
outcomes and much harder to predict another outcome, in which case the percent
correctly predicted can be misleading as a goodness-of-fit statistic. More informative
is to compute the percent correctly predicted for each outcome, y = 0 and y = 1.
Const. -90.395
(2.075)∗∗∗
Obs. 10000
Log-likelihood -5684.679
Pseudo-R2 0.165
Successes correctly predicted (%) 84.7
Failures correctly predicted (%) 57.2
Mean of "year born" 1962.627
Confidence: *** ↔ 99%, ** ↔ 95%, * ↔ 90%.
11 [Link]@[Link]
1.5 Normalisations in the probit model
This clearly presents a problem: the best that we can now do is to identify the objects (β0 − µ)·σ −1
and β1 · σ −1 . That is, the earlier assumptions that µ = 0 and σ = 1 are identifying assumptions:
they are normalisations without which we cannot identify either β0 or β1 .
12 [Link]@[Link]
1.6 Interpreting the results: Marginal effects
This should not come as a surprise: remember that we can always take a monotone increasing
transformation of a utility function without changing any of the observed choices. This has an
important implication for the way that we interpret the magnitude of parameter estimates from
discrete choice models; as Train explains (2009, page 24, emphasis in original):
The [estimated coefficients in a probit model] reflect, therefore, the effect of the ob-
served variables relative to the standard deviation of the unobserved factors.
In a binary outcome model, a given marginal effect is the ceteris paribus effect of changing one
individual characteristic upon an individual’s probability of ‘success’. In the context of the Tan-
zanian education data, the marginal effects measure the predicted difference in the probability of
primary school attainment between individuals born one year apart.
Having estimated the parameters β̂0 and β̂1 , the estimated marginal effects follow straightfor-
wardly. For an individual i born in year xi , the predicted probability of completing primary educa-
tion is:
Pr(yi = 1 | xi ; β̂0 , β̂1 ) = Φ β̂0 + β̂1 · xi . (1.36)
Had the ith individual been born a year later, (s)he would have a predicted probability of complet-
ing primary education of:
Φ β̂0 + β̂1 · (xi + 1) . (1.37)
For the ith individual, the estimated marginal effect of the variable x is therefore:
Md (xi ; β̂0 , β̂1 ) = Φ β̂0 + β̂1 · (xi + 1) − Φ β̂0 + β̂1 · xi . (1.38)
Md (xi ; β̂0 , β̂1 ) provides the marginal effect for the discrete variable xi . If xi were continuous — or
treated as being continuous for simplicity (an approximation that often works well) — we would
instead use:
∂ Pr(yi = 1 | xi ; β̂0 , β̂1 )
Mc (xi ; β̂0 , β̂1 ) = (1.39)
∂xi
= β̂1 · φ β̂0 + β̂1 · xi . (1.40)
13 [Link]@[Link]
1.6 Interpreting the results: Marginal effects
Figure 1.4: Probit estimates and marginal effects for primary school attainment in Tanzania
Figure 1.4 shows the predicted probabilities of success for the Tanzanian data — as in Figure 1.3
— but superimposes the estimated marginal effects (where, for simplicity, I have treated year of
birth as a continuous variable). You will see the the estimated marginal effect is greatest for in-
dividuals born in 1959 — and that this is the year for which the predicted probability of primary
attainment is (approximately) 0.5. This is clearly no coincidence: the function φ(x) is maximised
at x = 0, and Φ(0) = 0.5. This restriction — i.e. that the marginal effect is largest for individuals
with a predicted probability of 0.5 — can be relaxed by, for example, the ‘scobit’ estimator. This
estimator, however, is beyond the scope of our course.
Figure 1.4 shows one way of reporting the marginal effects — i.e. by calculating the marginal
effects separately for all individuals in the sample, and then graphing. But there are several al-
ternative approaches: for example, statistical packages generally report either the average of the
marginal effects across the sample, or the marginal effect at the mean of the regressors.7 Alterna-
tively, you may wish to take some weighted average of the sample marginal effects, if the sample
is unrepresentative of the population of interest. Table 1.1 earlier reported both the mean marginal
effect and the marginal effect at the mean.
7
Cameron and Trivedi (page 467) prefer the former; they say, “it is best to use. . . the sample average of the marginal
effects. Some programs instead evaluate at the sample average of the regressors. . . ”.
14 [Link]@[Link]
1.7 Appendix to Lecture 1: Stata code
In short, the marginal effects are particularly important for binary outcome variables, and it is
generally a very good idea to report marginal effects alongside estimates of the parameters (or,
indeed, instead of them). Standard statistical packages can compute estimated marginal effects
straightforwardly — and, similarly, can use the delta method to calculate corresponding standard
errors.
clear
use WorkingSample
We can then tabulate primaryplus, the dummy variable that records whether or not a respon-
dent has primary education (or higher):
tab primaryplus
Similarly, let’s summarise the variable yborn, which records the year in which each respondent
was born:
summarize yborn
Time to estimate. We begin with our probit model, explaining primaryplus by yborn (and a
constant):
Finally, let’s calculate marginal effects — first as the mean across the sample, and then as the
marginal effect at the mean of yborn:
margins, dydx(yborn)
margins, dydx(yborn) atmean
15 [Link]@[Link]
2 Lecture 2: Binary Choice II
Required readings (for Lectures 1 and 2):
• ? C AMERON , A.C. AND T RIVEDI , P.K. (2005): Microeconometrics: Methods and Appli-
cations. Cambridge University Press, pages 463 – 478 (i.e. sections 14.1 to 14.4, inclusive)
or
• ? W OOLDRIDGE , J. (2002): Econometric Analysis of Cross Section and Panel Data. The
MIT Press, pages 453 – 461 (i.e. sections 15.1 to 15.4, inclusive)
or
• ? W OOLDRIDGE , J. (2010): Econometric Analysis of Cross Section and Panel Data (2nd
ed.). The MIT Press, pages 561 – 569 (i.e. sections 15.1 to 15.4, inclusive).
Other references:
• A NGRIST, J.D. AND P ISCHKE , J.S. (2008): Mostly Harmless Econometrics: An Empiri-
cist’s Companion. Princeton University Press.
An alternative approach is to assume that the latent unobservable has a ‘logistic distribution’:
Figure 2.1 shows the cdf of the logistic distribution, compared to the normal.
16 [Link]@[Link]
2.1 The logit model
Equation 2.4 is directly analogous to equation 1.14; it defines the ‘logit model’. The logit model is
an alternative to the probit model for estimating the conditional probability of a binary outcome.
For any given dataset, the predicted probabilities from a logit model are generally almost identical
to those from a probit model, as we will see later in this lecture.
All of the reasoning from Lecture 1 extends by analogy to the case of the logit model: we can
follow the same principles to (i) form the log-likelihood, (ii) maximise the log-likelihood, (iii)
measure the goodness-of-fit, (iv) normalise our parameter estimates and (v) interpret the marginal
effects. We will not rehearse these principles in this lecture, but you should understand the way
that they extend from the probit case to the logit case.
17 [Link]@[Link]
2.2 The log-odds ratio in the logit model
In the logit model, we can therefore interpret the index β0 + β1 xi as providing the ‘log odds ratio’,
so that the parameter β1 shows the effect of xi on this log ratio:
18 [Link]@[Link]
2.4 The Linear Probability Model
Figure 2.2: Probit estimates and logit estimates for primary school attainment in Tanzania
A simpler approach is to assume that the conditional probability of success — and, therefore, the
conditional expectation of the outcome — is linear in the explanatory variable(s):
E(yi | xi ; β0 , β1 ) = β0 + β1 xi (2.16)
⇔ yi = β0 + β1 xi + εi , (2.17)
19 [Link]@[Link]
2.4 The Linear Probability Model
where E(εi | xi ) = 0.
This is known as the ‘Linear Probability Model’, or ‘LPM’ for short. As equation 2.17 implies,
the parameters of interest for the LPM can be obtained very simply: just use OLS. We will not
rehearse here the principles involved in OLS estimation.
2.4.1 Predicted probabilities and marginal effects in the Linear Probability Model
Predicted probabilities in the LPM are trivial:
c yi = 1 | xi ; β̂0 , β̂1 = β̂0 + β̂1 xi .
Pr (2.18)
Note that nothing constrains this predicted probability to lie in the unit interval. We will return to
this point shortly.
Marginal effects in the LPM are similarly trivial: whether xi is discrete or continuous, its estimated
marginal effect is β̂1 . Note that this marginal effect is identical across all values of x.
Figure 2.3 illustrates. We know that Var(εi | xi ) = E (ε2i | xi ) − [E (εi | xi )]2 , and — as we noted
earlier — E(εi | xi ) = 0. We therefore have:
Var(εi | xi ) = E ε2i | xi
(2.20)
= Pr(yi = 1 | xi ) · (1 − β0 − β1 xi )2 + Pr(yi = 0 | xi ) · (−β0 − β1 xi )2 (2.21)
2 2
= (β0 + β1 xi ) · (1 − β0 − β1 xi ) + (1 − β0 − β1 xi ) · (−β0 − β1 xi ) (2.22)
= (β0 + β1 xi ) · (1 − β0 − β1 xi ) . (2.23)
Therefore, Var(εi | xi ) depends upon xi so long as β1 6= 0.9 The simplest way of dealing with this
problem is to use White’s heteroskedasticity-robust standard errors (which can be implemented
straightforwardly in Stata using the ‘robust’ option). Alternatively, we could use Weighted
Least Squares; this produces more efficient estimates, but requires predicted probabilities to lie
between 0 and 1 (which, as we discussed, is not guaranteed in the LPM).
9
Note, then, that if we are testing a null hypothesis H0 : β1 = 0 in this model, we do not need to worry about
heteroskedasticity.
20 [Link]@[Link]
2.5 LPM or MLE?
... .......
..
...
. .
...
..
.. .......
...
.......
...
.......
.......
...
.... .......
...
. ..
..
.
.
... .......
.......
... .... .......
... . .......
... ...
.........
.
...
.......... ........ ........ ........ ........ ........ ........ ........ ........ ........ ........ ........ ...................... ........ ........ ........ ........ ........ ........ ........ ........ ........ ........ ........ ........
... ...... .
.......
...
.. ..
........... .
.
.
... ....... ..
.......
... .......
.
... ....... .....
.......
... .......
.......
...
....... .
... ......
.....
....
... .......
.......
... ....... .
...
...
...
.......
.......
.......
.........
.
β0 + β1 xi .....
.
... . ...
... .....
.......
...
.......
...
....... .
... .............
.....
..............
...
.
... .....
...
0
...
xi · .
..................................................................................................................................................................................................................................................................................................................................................................................................
.... x
This can be quite a controversial issue in applied research! On the one hand, many researchers
prefer the probit or logit models, on the basis that they constrain predicted probabilities to the
unit interval, and that they therefore imply sensible marginal effects across the entire range of
explanatory variables. Cameron and Trivedi, for example, say (page 471):
Although OLS estimation with heteroskedastic standard errors can be a useful ex-
ploratory data analysis tool, it is best to use the logit or probit MLE for final data
analysis.
In a 2011 article about Randomised Controlled Trials (‘RCT’) in the Journal of African Economies,
Harrison said this about the use of OLS for limited dependent variable models (footnote omitted):10
10
Harrison also discussed the issue in his presentation at the 2011 CSAE Annual Conference, available at http:
//[Link]/conferences/2011-EdiA/[Link].
21 [Link]@[Link]
2.5 LPM or MLE?
One side-effect of the popularity of RCT is the increasing use of Ordinary Least
Squares estimators when dependent variables are binary, count or otherwise truncated
in some manner. One is tempted to call this the OLS Gone Wild reality show, akin to
the Girls Gone Wild reality TV show, but it is much more sober and demeaning stuff.
I have long given up asking researchers in seminars why they do not just report the
marginal effects for the right econometric specification. Instead I ask if we should just
sack those faculty in the room who seem to waste our time teaching things like logit,
count models or hurdle models.
In their book Mostly Harmless Econometrics, Angrist and Pischke (2009, page 94) take a different
approach:
Should the fact that a dependent variable is limited affect empirical practice? Many
econometrics textbooks argue that, while OLS is fine for continuous dependent vari-
ables, when the outcome of interest is a limited dependent variable (LDV), linear re-
gression models are inappropriate and nonlinear models such as probit and Tobit are
preferred. In contrast, our view of regression as inheriting its legitimacy from the
[Conditional Expectation Function] makes LDVness less central.
That is, the Linear Probability Model can still be used to estimate the average marginal effect.
Cameron and Trivedi acknowledge (page 471) that:
The OLS estimator [that is, the Linear Probability Model] is nonetheless useful as an
exploratory tool. In practice it provides a reasonable direct estimate of the sample-
average marginal effect on the probability that y = 1 as x changes, even though it
provides a poor model for individual probabilities. In practice it provides a good guide
to which variables are statistically significant.
Further, the Linear Probability Model is sometimes preferred for computational reasons; maximum
likelihood models can prove much more difficult to estimate where, for example, there is a very
large number of observations or a large number of explanatory variables.
22 [Link]@[Link]
2.5 LPM or MLE?
Table 2.1: Probit, logit and LPM results from Tanzania
Correctly predicted:
Successes (%) 84.7 84.7 86.3
Failures (%) 57.2 57.2 55.2
Confidence: *** ↔ 99%, ** ↔ 95%, * ↔ 90%.
‘Marginal’ refers to the mean marginal effect. The Linear Probability Model was run using White’s heteroskedasticity-
robust standard errors.
Figure 2.4: LPM, probit and logit estimates for primary school attainment in Tanzania
23 [Link]@[Link]
2.6 The single-index assumption
In most empirical applications, however, we have more than one explanatory variable. It is straight-
forward to take all of our previous reasoning on xi and generalise it to a vector xi , by replacing
β0 + β1 xi with the linear index β · xi (where, generally, xi is understood as including an element
‘1’, to allow an intercept). This is how we deal with multiple explanatory variables in the context
of the probit, logit and LPM models; thus, in the multivariate case, we specify either:
This is a very general structure; it permits quite flexible estimation of binary outcome models
with a large number of explanatory variables. However, note that the explanatory variables enter
linearly through a ‘single index’, β · xi . It is easy to think of functions that violate this assumption.
For example, the left surface of Figure 2.5 shows the function y = Φ(3(x1 + x2 − 1)); this
satisfies the single index assumption because we can write y = F (β · x). But the right surface in
Figure 2.5 shows the function y = 0.5 (Φ(10x1 − 3) + Φ(10x2 − 3)); this cannot be expressed as
y = F (β · x), so it violates the single-index assumption.
Pr(yi = 1 | xi ) = F (β · xi ) , (2.27)
where F (z) = Φ(z) for probit, F (z) = Λ(z) for logit and F (z) = z for the LPM. F can be
referred to as a ‘link function’. If F (z) is a cdf — as it is, for example, for probit and logit
— then we can rewrite all of our earlier maximum likelihood results more generally in terms of
F (z). This is the way, for example, that Cameron and Trivedi introduce probit and logit (see pages
465 to 469 of their text); Wooldridge takes the same approach (se pages 457 – 458 of his 2002 text).
24 [Link]@[Link]
2.8 Appendix to Lecture 2: Stata code
Figure 2.5: The single index restriction: an example (left) and a violation (right)
The surface on the left shows the function y = Φ(3(x1 + x2 − 1)); the graph on the right shows
the function y = 0.5 (Φ(10x1 − 3) + Φ(10x2 − 3)). Thus, the surface on the left may be
expressed as y = f (β · x), but the surface on the right requires a bivariate function y = g(x1 , x2 ).
More generally, equation 2.27 permits semiparametric estimation, in which a researcher can jointly
estimate the parameter vector β and the link function F . In our simple application with one ex-
planatory variable, this kind of approach just implies fitting a univariate nonparametric function,
y = f (xi ) + εi , where E(εi | xi ) = 0. Figure 2.6 illustrates, where the function F is fitted with a
kernel.
You do not need to understand any nonparametric or semiparametric methods for these lectures.
However, the underlying point is worth remembering: the probit, logit and LPM models all impose
particular assumptions on the data, and we can sometimes relax these assumptions using more
flexible estimation techniques. (Some of these techniques are covered in the second-year [Link]
course ‘Advanced Econometrics 1 – Microeconometrics’.)
clear
use WorkingSample
25 [Link]@[Link]
2.8 Appendix to Lecture 2: Stata code
Figure 2.6: Probit and kernel estimates for primary school attainment in Tanzania
margins, dydx(yborn)
margins, dydx(yborn) atmean
Finally, we can run the Linear Probability Model using the command regress, for an OLS
regression; we add the option ‘robust’ to calcuate White’s heteroskedasticity-robust standard
errors:
26 [Link]@[Link]
3 Lecture 3: Discrete ordered choice
Required reading:
• ? C AMERON , A.C. AND T RIVEDI , P.K. (2005): Microeconometrics: Methods and Appli-
cations. Cambridge University Press, pages 519 – 520 (i.e. section 15.9.1)
or
• ? W OOLDRIDGE , J. (2002): Econometric Analysis of Cross Section and Panel Data. The
MIT Press, pages 504 – 507 (i.e. section 15.10)
or
• ? W OOLDRIDGE , J. (2010): Econometric Analysis of Cross Section and Panel Data (2nd
ed.). The MIT Press, pages 655 – 659 (i.e. sections 16.3.1 and 16.3.2).
Other references:
• C UNHA , F., H ECKMAN , J. AND NAVARRO , S. (2007): “The Identification and Economic
Content of Ordered Choice Models with Stochastic Thresholds,” International Economic
Review, 48(4), 1273–1309.
We will model this education decision as an ordered choice. It is clear that, in some intuitive
sense, the categories ‘no education’ – ‘primary education’ – ‘secondary education’ are ordered; for
27 [Link]@[Link]
3.2 A simple optimal stopping model
Figure 3.1: Primary and secondary school attainment in Tanzania across age cohorts
example, secondary education requires more time than primary education, which itself (obviously)
requires more time than no education. This kind of intuitive reasoning often justifies the description
of a choice as a ‘discrete ordered choice’. Ideally, though, we should be able to go further: we
should be able to describe the outcome as a monotone step function of some continuous latent
variable. To illustrate what this might mean, we will consider a simple microeconomic model of
Tanzanians’ investment in education.
28 [Link]@[Link]
3.2 A simple optimal stopping model
For simplicity, let’s assume that the student faces only three choices: (i) do not attend school
(s = 0), (ii) finish primary school (s = 7), and (iii) finish secondary school (s = 12). We will
assume that students have a lifetime of known finite duration T > 12 years and, for simplicity, we
will make the extreme assumption that students assign equal utility weight to each period.12 Given
these assumptions, we can write three value functions, one corresponding to each choice:
V0 (0, xi , εi ) = 0 (3.4)
V0 (7, xi , εi ) = 7 · (β0 + β1 xi + εi ) + (T − 7) · 7α (3.5)
V0 (12, xi , εi ) = 12 · (β0 + β1 xi + εi ) + (T − 12) · 12α. (3.6)
β0 + β1 xi + εi ≥ (7 − T ) · α. (3.7)
κ1 = α · (7 − T ) − β0 (3.10)
κ2 = α · (19 − T ) − β0 , (3.11)
and express the ith student’s decision (yi ) as an ordered choice in the latent variable β1 xi + εi :
0 if β1 xi + εi < κ1 ;
y(xi , εi ; β1 , κ1 , κ2 ) = 1 if β1 xi + εi ∈ [κ1 , κ2 ) ; (3.12)
2 if β1 xi + εi ≥ κ2 .
Our simple optimal stopping model therefore implies that y(x, ε; β0 , β1 ) is a monotone step func-
tion in β1 xi + εi . Cunha, Heckman and Navarro (2007) discuss several classes of models —
including a dynamic schooling choice model — that imply this kind of monotone step function
solution. Figure 3.2 illustrates.
Notice that, in this model, the observable covariate x affects the latent index rather than the cut-
points; for this reason, we can describe the Ordered Probit as a model of ‘index shift’. There are
two reasons that this result matters for empirical analysis:
(i) We may wish to exploit the ordered nature of the outcome variable for more efficient esti-
mation;
(ii) We may wish to test the microeconomic model by testing the implication that x affects
educational choice through ‘index shift’.
12
That is, we will use a subjective discount factor of 1.
13
We will assume that the indifferent student chooses the higher level of education.
29 [Link]@[Link]
3.3 The Ordered Probit
y(xi , εi ; β1 , κ1 , κ2 )
2 ..
...
...
· ..............................................................................................................................................
...
...
... ...
... ...
... ...
... ...
... ...
... ...
... ...
... ...
... ...
... ...
... ...
... ...
... ...
1 · ...
.....................................................................................................................................................
...
...
...
...
...
... ...
... ...
... ...
... ...
... ...
... ...
... ...
... ...
... ...
... ...
... ...
... ...
... ...
0 ................................................................................................................................................................... ........ ........ ........ ........ ........ ........ ........ ........ ........ ..... ........ ........ ........ ........ ........ ........ ........ ........ ........ .............
. .. . .
.
... ... β1 xi + εi
κ1 κ2
Armed with this assumption, it is straightforward to write the log-likelihood for the ith individual:
ln Φ (κ1 − β1 xi ) if yi = 0;
`i (β1 , κ1 , κ2 ; yi | xi ) = ln [Φ (κ2 − β1 xi ) − Φ (κ1 − β1 xi )] if yi = 1; (3.14)
ln [1 − Φ (κ2 − β1 xi )] if yi = 2.
30 [Link]@[Link]
3.5 The Ordered Probit in Tanzania
Obs. 10000
Log-likelihood -7972.275
Pseudo-R2 0.105
Confidence: *** ↔ 99%, ** ↔ 95%, * ↔ 90%.
31 [Link]@[Link]
3.6 The Generalised Ordered Probit
Figure 3.3: Ordered Probit estimates for primary and secondary school attainment in Tanza-
nia across age cohorts
However, we might be concerned that this structure is too restrictive. After all, there might be many
good reasons that, over time, students have become less likely to complete secondary education
and less likely to complete no education at all (i.e. with more students stopping after primary
school). This might be the case if, for example, the cost of primary education has fallen over time
but the cost of secondary education has increased. In that case, we may still believe that educational
choice is a monotone step function in the student’s unobserved taste for education (εi ), but we may
32 [Link]@[Link]
3.6 The Generalised Ordered Probit
want to allow the explanatory variable to affect each cutpoint differently. That is, we may want to
use a model of ‘cutpoint shift’, rather than of ‘index shift’:
0 if εi < κ1 − γ1 xi ;
y(xi , εi ; β1 , κ1 , κ2 ) = 1 if εi ∈ [κ1 − γ1 xi , κ2 − γ2 xi ) ; (3.18)
2 if εi ≥ κ2 − γ2 xi .
This model is identical to our earlier model in the special case γ1 = γ2 = β1 . But, by allowing γ1
and γ2 to vary separately, we can allow for a more flexible model while still exploiting the ordered
structure of the decision. (Note, of course, that we haven’t gone back to modify our simple opti-
mal stopping model to reflect this change; however, we could certainly do so — for example, by
allowing xi to affect the cost of each schooling level differently.) Figure 3.4 illustrates this more
general model.
y(xi , εi ; γ1 , γ2 , κ1 , κ2 )
2 ..
..
..
.
· ..............................................................................................................................................
..
..
.
... ..
.. ..
. .
... ..
.. ..
. .
... ...
... ...
.. ...
... ...
.. ...
... ...
.. ...
... ...
.. ...
1 · ...
...
...
...
..................................................................................................................................................
..
.
...
...
... ...
... ...
... ...
... ...
... ...
... ...
.. ..
... ...
.. ..
... ...
.. ..
... ...
.. ..
0 ........................................................................................................................................................................ ........ ........ ........ ........ ........ ........ ........ ........ ........ ..... ........ ........ ........ ........ ........ ........ ........ ........ ........ .............
... ... εi
κ1 − γ 1 x i κ2 − γ2 xi
If we maintain the assumption that εi has a standard normal distribution, we can describe this new
model as a ‘Generalised Ordered Probit’. We will not write the log-likelihood for this model,
but it is straightforward and directly analogous to the log-likelihood for the Ordered Probit. Table
3.2 shows the estimation results, with estimated mean marginal effect. Compared to the Ordered
Probit, the Generalised Ordered Probit implies a slightly higher mean marginal effect upon the
probability of primary education (yi = 1), but a slightly lower effect upon the probability of
secondary (yi = 2).
33 [Link]@[Link]
3.6 The Generalised Ordered Probit
Table 3.2: Estimates from Tanzania: Generalised Ordered Probit
Cutoff 1:
Year born 0.045
(0.001)∗∗∗
Const. 88.725
(2.017)∗∗∗
Cutoff 2:
Year born 0.01
(0.001)∗∗∗
Const. 21.794
(2.882)∗∗∗
Obs. 10000
Log-likelihood -7779.772
Pseudo-R2 0.126
Confidence: *** ↔ 99%, ** ↔ 95%, * ↔ 90%.
Figure 3.5 shows the consequent predicted probabilities. Figure 3.6 shows the estimated cutoff
functions for the Generalised Ordered Probit (that is, κ̂1 − γ̂1 xi and κ̂2 − γ̂2 xi ) — along with
the cutoffs for the Ordered Probit (κ̂1 − β̂1 xi and κ̂2 − β̂1 xi ). The diagram shows the fundamental
difference between the Ordered Probit and Generalised Ordered Probit: the Ordered Probit restricts
the cutoff functions to be parallel. Of course, this may or may not be a valid (or useful) restriction,
depending on our particular empirical context. We can test the restriction straightforwardly: you
should verify that, using a Likelihood Ratio test, we can compare the results in Tables 3.2 and
3.1 and obtain LR = 2 × (7972.275 − 7779.772) = 385.006, which implies a tiny p-value when
compared to a χ2 (1) distribution.
34 [Link]@[Link]
3.6 The Generalised Ordered Probit
Figure 3.5: Generalised Ordered Probit estimates for primary and secondary school attain-
ment in Tanzania across age cohorts
Figure 3.6: Estimated cutoff functions: Ordered Probit and Generalised Ordered Probit
35 [Link]@[Link]
3.7 The Ordered Logit and Generalised Ordered Logit
yi = β0 + β1 xi + εi , (3.19)
where yi again refers to our three-outcome measure of educational achievement and xi is again year
of birth. That is, we could simply run an OLS regression of yi on xi . However, it is very difficult
— if not impossible — to justify this approach. The reason for the difficulty is simple: as we noted
earlier, yi is a categorial outcome, where the values ‘0’, ‘1’ and ‘2’ have no cardinal meaning. It is
therefore not meaningful to talk about a ‘one unit increase in the outcome variable’ (for example,
we cannot interpret our estimate of β1 in terms of a marginal effect on a conditional probability).
Unfortunately, it is not uncommon to see researchers using specifications like equation 3.19 for
studying discrete outcomes.
Instead, we ought to estimate in a way that respects the categorical nature of the dependent variable.
If we want to use a linear probability structure, we can do this by using multiple LPM estimates.
In our Tanzanian example, we can do this by defining two new binary outcomes:
1 if yi = 1.
pi = (3.20)
0 if yi 6= 1;
1 if yi = 2.
si = (3.21)
0 if yi 6= 2;
We can then run two separate Linear Probability Models to estimate the effect of xi on the proba-
bility of primary compltion and the probability of secondary completion:
pi = γ0 + γ1 xi + εi (3.22)
si = δ0 + δ1 xi + µi . (3.23)
Figure 3.7 shows the resulting estimates. We can compare this graph directly to Figure 3.5. Of
course, the estimates illustrated in Figure 3.7 are not necessarily good estimates: all of the objec-
tions to the Linear Probability Model that we discussed in Lecture 2 still apply. Arguably, these
36 [Link]@[Link]
3.8 The Linear Probability Model and discrete ordered choice
objections apply with even more force where the dependent variable has multiple outcomes: we
may think that it is even more important, in this case, to use an estimator that can be rationalised
in terms of an underlying economic structure. But these estimates can at least be defended as
providing reasonable estimates of the marginal effect of xi on the probability of choosing yi = 1
and the probability of choosing yi = 2. Unfortunately, this is not something that we can say about
equation 3.19.14
Figure 3.7: Linear Probability Model estimates for primary and secondary school attainment
in Tanzania across age cohorts
14
I have introduced this ‘multiple LPM’ approach as an alternative to the Generalised Ordered Probit. We could also
use it as an alternative to models of discrete multinomial choice (i.e. ‘unordered’ choice), which we will discuss in
Lecture 4. However, as we will see in that lecture, models of unordered choice have traditionally placed particular
emphasis upon having choice-theoretic foundations — which, as we saw in Lecture 2, the Linear Probability Model
does not provide.
37 [Link]@[Link]
3.9 Appendix to Lecture 3: Stata code
We can start by clearing the memory and loading the data — as we did previously. Then, we can
tabulate our categorical education variable:
tab educ_cat
We can then calculate mean marginal effects for the outcomes y = 1 and y = 2:
We can then fit the Generalised Ordered Probit using the goprobit command:
(Note that goprobit actually estimates, in our terminology, −κ1 and −κ2 , rather than κ1 and κ2 .
Note also that this command may not be installed on your computer; the command is not currently
built in to Stata, so you may have to download it separately.)
The same margins commands will then calculate mean marginal effects.
To use multiple Linear Probability Models instead, we can generate new dummy variables, then
run OLS regressions:
gen p = (educ_cat == 1)
gen s = (educ_cat == 2)
reg p yborn, robust
reg s yborn, robust
38 [Link]@[Link]
4 Lecture 4: Discrete multinomial choice
Required reading:
• ? C AMERON , A.C. AND T RIVEDI , P.K. (2005): Microeconometrics: Methods and Appli-
cations. Cambridge University Press, pages 490 – 506 (i.e. sections 15.1 to 15.5.3, inclusive)
or
• ? W OOLDRIDGE , J. (2002): Econometric Analysis of Cross Section and Panel Data. The
MIT Press, pages 497 – 502 (i.e. section 15.9.1 and part of section 15.9.2)
or
• ? W OOLDRIDGE , J. (2010): Econometric Analysis of Cross Section and Panel Data (2nd
ed.). The MIT Press, pages 643 – 649 (i.e. sections 16.1, 16.2.1 and part of 16.2.2).
Other references:
• L EWIS , W.A. (1954): “Economic Development with Unlimited Supplies of Labour,” The
Manchester School, 22(2), 139–191.
The main sources from which workers come as economic development proceeds are
subsistence agriculture, casual labour, petty trade, domestic service, wives and daugh-
ters in the household, and the increase of population. In most but not all of these
sectors, if the country is overpopulated relatively to its natural resources, the marginal
productivity of labour is negligible, zero, or even negative.
Lewis (1954)
39 [Link]@[Link]
4.1 Occupational choice in Tanzania
In this lecture, we consider occupational choice in Tanzania. Both geographically and conceptu-
ally, the Tanzanian labour market is a long way from the San Francisco Bay Area Rapid Transit
system (the ‘BART’). Nonetheless, we will analyse occupational choice using some of the econo-
metric methods that Daniel McFadden famously developed to predict demand for the new BART.
Like McFadden, our concern shall be to estimate the conditional probability of various discrete
and unordered choices, and to do so with — as McFadden termed it — “a solid foundation in
behavioral theory”.
Let’s begin in Tanzania. Figure 4.1 describes occupational choice among employed Tanzanians
of different ages. The figure — and our subsequent analysis — uses a ternary outcome variable,
covering three mutually exlusive categories:
1 if the ith respondent works in agriculture;
yi = 2 if the ith respondent is self-employed (outside of agriculture); (4.1)
3 if the ith respondent is wage employed (outside of agriculture).
We will not worry too much today about why occupational choice in Tanzania might matter; as
in earlier lectures, we will use the Tanzanian data as an illustrative vehicle for our econometric
techniques. However, it is not difficult to see why this kind of occupational choice might be
important for understanding Tanzania’s development; the quote from Lewis’s famous 1954 paper,
40 [Link]@[Link]
4.2 An Additive Random Utility Model
for example, highlights sectoral shifts as an important mechanism for long-run development, and
the data in Figure 4.1 might provide insights into the flexibility with which workers can achieve
such shifts. (For example, if older workers are more likely to choose employment in agriculture
than younger workers, this may suggest some ‘switching costs’ between sectors.)
Suppose, therefore, that we again have data on N individuals, indexed i ∈ {1, . . . , N }. Assume
that each individual makes a choice yi = j, where there are a finite number J options available.
Critically, suppose that we observe information at the level of each individual, including his/her
choices (that is, we observe xi and yi ). That is, we do not observe information at the level of each
available option; we will consider this alternative kind of data structure later in this lecture. You
may query how reasonable it may be to model occupational outcomes purely as a matter of choice
— after all, could an agricultural employee simply choose to take a wage job? — but we will leave
this concern aside for this lecture.
As in Lecture 1, we will assume that the ith individual’s utility from the jth choice is determined
by an additive random utility model:
(j) (j)
Uij (xi ) = α0 + α1 xi + εij . (4.2)
Thus, for example, for choices j ∈ {1, 2, 3}, the individual obtains the following utilities:
(1) (1)
Ui1 (xi ) = α0 + α1 xi + εi1 (4.3)
(2) (2)
Ui2 (xi ) = α0 + α1 xi + εi2 (4.4)
(3) (3)
Ui3 (xi ) = α0 + α1 xi + εi3 . (4.5)
Together, these three utilities determine the choice of an optimising agent. Figure 4.2 illustrates
preferences between the three options in two-dimensional space; in each box, the bold outcome
represents the agent’s choice.
41 [Link]@[Link]
4.2 An Additive Random Utility Model
...
..... 3≺1 ...
.....
.. ...
..
.. ...
..
..
.......
. ............
......... ...
We can, therefore, express the conditional probability of the ith individual choosing, say, option 1:
Pr(yi = 1 | xi ) = Pr U (1) (xi ) > U (2) (xi ) and U (1) (xi ) > U (3) (xi ) | xi
(4.6)
h
(1) (1) (2) (2)
= Pr α0 + α1 xi + εi1 > α0 + α1 xi + εi2 and
i
(1) (1) (3) (3)
α0 + α1 xi + εi1 > α0 + α1 xi + εi3 | xi . (4.7)
More generally, if the ith individual were to choose yi = j out of J choices, we could write:
(j) (k)
Pr(yi = j | xi ) = Pr U (xi ) > max U (xi ) | xi (4.8)
k6=j
j j k k
= Pr α0 + α1 xi + εij > max α0 + α1 xi + εik | xi . (4.9)
k6=j
In order to estimate using equation 4.9, we again need to make a distributional assumption.
42 [Link]@[Link]
4.3 The Multinomial Logit model
Figure 4.3: Cumulative density functions: Normal and Type I Extreme Value distributions
Figure 4.4 shows how this distributional assumption might imply the different outcomes yi = 1,
yi = 2 and yi = 3; the figure shows the same two-dimensional space as Figure 4.2, but with
simulated values for Ui1 , Ui2 and Ui3 . (For simplicity, I have generated the graph by setting all of
(j) (j)
the parameters α0 and α1 to zero; that is, the graph shows variation generated solely by the Type
I Extreme Value distribution on εij .)
43 [Link]@[Link]
4.3 The Multinomial Logit model
With this distributional assumption, we can now find an expression for the conditional probability
that the ith individual chooses outcome j from J choices.15 Note that you do not need to memorise
this derivation for the exam; however, I think the derivation is useful for understanding the under-
lying structure required by multinomial choice models.
First, suppose that the error term for the chosen option, εij , were known. Then we could write:
(j) (k)
Pr(yi = j | xi , εij ) = Pr U (xi ) > max U (xi ) xi , εij (4.13)
k6=j
15
This derivation is taken from Train (2009, pages 74-75).
44 [Link]@[Link]
4.3 The Multinomial Logit model
Of course, εij is not known; we therefore need to integrate across its possible values:
Z ∞
Pr(yi = j | xi ) = f (εij ) · Pr(yi = j | xi , εij ) dεij (4.17)
−∞
Z ∞
= exp (−εij ) · exp [− exp (−εij )]
−∞
Y
exp − exp − εij + α0j + α1j xi − α0k − α1k xi
· dεij (4.18)
k6=j
Z ∞ Y
exp − exp − εij + α0j + α1j xi − α0k − α1k xi
= exp (−εij ) · dεij
−∞ k
(4.19)
( )
Z ∞ X
exp − εij + α0j + α1j xi − α0k − α1k xi
= exp (−εij ) · exp − dεij
−∞ k
(4.20)
Z ∞
= exp (−εij )
−∞
( )
X
exp − α0j + α1j xi − α0k − α1k xi
· exp − exp(−εij ) · dεij . (4.21)
k
We can now integrate by substitution. Define t = exp(−εij ), so that dt = − exp(−εij ) · dεij . Note
that limεij →−∞ t = ∞ and limεij →∞ t = 0. Then we can rewrite our integral as:
Z ∞ ( )
X
exp − α0j + α1j xi − α0k − α1k xi
Pr(yi = j | xi ) = exp −t · dt (4.22)
0 k
" #∞
exp −t · k exp − α0j + α1j xi − α0k − α1k xi
P
= (4.23)
− k exp − α0j + α1j xi − α0k − α1k xi
P
0
1
=P j j k k
(4.24)
k exp − α0 + α1 xi − α0 − α1 xi
exp α0j + α1j xi
=P k k
. (4.25)
k exp α0 + α1 xi
45 [Link]@[Link]
4.3 The Multinomial Logit model
Let’s return to our example with three outcomes, y ∈ {1, 2, 3}. The last derivation implies that we
can write the conditional probabilities of the outcomes as:
(1) (1)
exp α0 + α1 xi
Pr(yi = 1 | xi ) = ; (4.26)
(1) (1) (2) (2) (3) (3)
exp α0 + α1 xi + exp α0 + α1 xi + exp α0 + α1 xi
(2) (2)
exp α0 + α1 xi
Pr(yi = 2 | xi ) = ; (4.27)
(1) (1) (2) (2) (3) (3)
exp α0 + α1 xi + exp α0 + α1 xi + exp α0 + α1 xi
(3) (3)
exp α0 + α1 xi
Pr(yi = 3 | xi ) = . (4.28)
(1) (1) (2) (2) (3) (3)
exp α0 + α1 xi + exp α0 + α1 xi + exp α0 + α1 xi
It would be tempting to take these three conditional probabilities and write the log-likelihood; for
our three outcomes, we could therefore try to maximise the log-likelihood across six unknown
(1) (2) (3) (1) (2) (3)
parameters (that is, the parameters α0 , α0 , α0 , α1 , α1 and α1 ). However, this would be
a mistake, because we would be unable to find a unique set of values that would maximise the
function. (That is, the model would be underidentified.) The reason, of course, is that we can
only ever express utility in relative terms: we have seen this principle already in deriving both
the probit and the Ordered Probit models. We therefore need to choose a ‘base category’, and
estimate relative to the utility from that category. We shall choose 1 as the base category, and
(2) (2) (1) (2) (2) (1) (3) (3)
define β0 ≡ α0 − α0 and β1 ≡ α1 − α1 (and symmetrically for β0 and β1 ). Note the
emphasis here that the choice of base category is arbitrary: our predicted probabilities would be
identical if we were to choose a different base category. Then we can multiply numerator and
(1) (1)
denominator of each conditional probability by exp(−α0 − α1 xi ), to obtain:
1
Pr(yi = 1 | xi ) = ; (4.29)
(2) (2)(3) (3)
1 + exp β0 ++ exp β0 + β1 xi
β1 xi
(2) (2)
exp β0 + β1 xi
Pr(yi = 2 | xi ) = ; (4.30)
(2) (2) (3) (3)
1 + exp β0 + β1 xi + exp β0 + β1 xi
(3) (3)
exp β0 + β1 xi
Pr(yi = 3 | xi ) = . (4.31)
(2) (2) (3) (3)
1 + exp β0 + β1 xi + exp β0 + β1 xi
46 [Link]@[Link]
4.4 Estimates from Tanzania
These conditional probabilities can then be used to define the log-likelihood; it is now straightfor-
ward that, for the ith individual, the log-likelihood is:16
(1) (1) (2) (2)
`i β0 , β1 , β0 , β1 ; yi | xi
= 1 (yi = 1) · ln [Pr(yi = 1 | xi )] + 1 (yi = 2) · ln [Pr(yi = 2 | xi )]
+ 1 (yi = 3) · ln [Pr(yi = 3 | xi )] . (4.32)
This log-likelihood function defines the ‘Multinomial Logit’ model. The Multinomial Logit is the
simplest model for unordered choice. (Note that, if J = 2, the Multinomial Logit collapses to the
logit model that we considered in Lecture 2.) Marginal effects in the Multinomial Logit model are
directly analogous to marginal effects in the earlier models.
16
I denote the indicator function by 1(·). Note that, for simplicity, I have not explicitly written each conditional
probability as depending upon the parameters of interest, though they clearly do.
47 [Link]@[Link]
4.4 Estimates from Tanzania
Table 4.1: Estimates from Tanzania: Multinomial Logit
Const. -36.383
(6.308)∗∗∗
Const. -48.562
(7.289)∗∗∗
Obs. 4136
Log-likelihood -4218.448
Pseudo-R2 0.006
Confidence: *** ↔ 99%, ** ↔ 95%, * ↔ 90%.
Figure 4.5: Occupational categories and age in Tanzania: Multinomial Logit estimates
48 [Link]@[Link]
4.5 From Multinomial Logit to Conditional Logit
Critically, this structure does not allow for observable characteristics of different options. How-
ever, we can allow straightforwardly for that possibility, by allowing the variable x to be indexed
by both individual and potential choice: xij . That is, we now assume that the researcher observes
information on characteristics of options that the ith individual did not choose — for example, a
researcher might know what the ith individual would have paid to take the train, even though she
actually chose the bus.17 We can therefore write Uij as a linear function of characteristics — and,
for the sake of generality, we now use vector notation to allow for multiple characteristics:18
Note that xij is indexed at the level of the option-individual combination; the vector includes char-
acteristics that vary at the level of the individual and the choice — for example, respondents may
face different relative costs of using different types of transport. Wooldridge cautions (2002, page
500) that “xij cannot contain elements that vary only across i and not j; in particular, xij does not
contain unity”. This means, therefore, that xij cannot include personal characteristics (for exam-
ple, age, sex, income, etc); we will see an intuitive reason for this shortly (in equation 4.39).
In the Multinomial Logit, the outcome y was indexed by individuals, and took the value of the
particular choice made; for example, we might write yi = j. But in the Conditional Logit model,
we need to express the outcome at the level of the individual-choice combination. Therefore, we
redefine our outcome as a binary variable:
1 if the ith individual chooses option j, and;
yij = (4.34)
0 if the ith individual chooses some other option k 6= j.
All of our reasoning from the Multinomial Logit extends to the Conditional Logit. The conditional
probability of individual i choosing outcome j is:
exp(β · xij )
Pr(yij = 1 | xi1 , . . . , xiJ ) = PJ . (4.35)
k=1 exp(β · xik )
17
Cameron and Trivedi provide an example of this kind of data structure in their Table 15.1 on page 492; in that
application, a researcher observes the price that different respondents faced for each of four types of fishing, even
though each respondent chose only one type.
18
Of course, we could also have used vector notation for all of our earlier reasoning in the Multinomial Logit model;
(1) (2)
this would have implied estimating two vectors β1 and β1 . But the scalar case captured all of the important
aspects of Multinomial Logit in a simpler context, and matched directly our illustrative empirical application.
49 [Link]@[Link]
4.6 Independence assumptions
h i
(A) (B) (A) (B)
= exp α0 − α0 + α1 − α1 · xi . (4.38)
That is, the ratio of probabilities for any two alternatives cannot depend upon how much the re-
spondents like any of the other alternatives on offer. Similarly, consider the Conditional Logit.
Using equation 4.35, the ratio of conditional probabilities for two choices is:
Cameron and Trivedi (page 503, emphasis in original) describe why these results are so concerning:
A limitation of the [Conditional Logit] and [Multinomial Logit] models is that dis-
crimination among the [J] alternatives reduces to a series of pairwise comparisons
that are unaffected by the characteristics of alternatives other than the pair under con-
sideration. . .
50 [Link]@[Link]
4.7 Appendix to Lecture 4: Stata code
little impact on car use and to halve use of the red bus, leading to an increase in the
conditional probability of car use given commute by car or red bus.
This weakness of MNL is known in the literature as the red bus – blue bus problem,
or more formally as the assumption of independence of irrelevant alternatives.
This is clearly a serious limitation of the conditional logit and multinomial logit. Indeed, in his
Nobel Prize Lecture in 2000, Daniel McFadden even went so far as to say (page 339):
The MNL model has proven to have wide empirical applicability, but as a theoretical
model of choice behaviour its IIA property is unsatisfactorily restrictive.
A variety of alternative models have been developed in order to relax these independence assump-
tions while still maintaining a clear basis in individual utility maximisation. For example, the
Alternative-Specific Multinomial Probit assumes that the values of εij are drawn from a multivari-
ate normal distribution with a flexible covariance matrix; this would allow, for example, that the
unobservable utility from taking a blue bus is very close to the unobservable utility from taking
a red bus. However, this model — like most other alternative models — does not admit a closed
form expression for the log-likelihood. The log-likelihood is therefore evaluated using simulation-
based methods (e.g. ‘Simulated Maximum Likelihood’). These models are beyond the scope of
our lectures — though they build directly upon the principles that we have discussed.
First, clear the memory and load the data, as in previous lectures. We can then tabulate the variable
WorkCat:
tab work_cat
We can estimate a multinomial logit — with a base category of 1 (agricultural employment) — by:
Mean marginal effects for wage employment and self-employment — categories 2 and 3 — can be
calculated by:
51 [Link]@[Link]
5 Lecture 5: Censored and trucated outcomes
Required reading:
• ? C AMERON , A.C. AND T RIVEDI , P.K. (2005): Microeconometrics: Methods and Appli-
cations. Cambridge University Press, pages 529 – 544 (i.e. sections 16.1 to 16.3.7, inclusive)
or
• ? W OOLDRIDGE , J. (2002): Econometric Analysis of Cross Section and Panel Data. The
MIT Press, pages 517 – 527 (i.e. sections 16.1 to 16.4, inclusive)
or
• ? W OOLDRIDGE , J. (2010): Econometric Analysis of Cross Section and Panel Data (2nd
ed.). The MIT Press, pages 667 – 677 (i.e. sections 17.1 to 17.3, inclusive).
Leading cases of incompletely observed data are truncation and censoring. For trun-
cated data some observations on both the dependent variable and the regressors are
lost. For example, income may be the dependent variable and only low-income people
are included in the sample. For censored data information on the dependent variable
is lost, but not data on the regressors. For example, people of all income levels may
be included in the sample, but for confidentiality reasons the income of high-income
people may be top-coded and reported only as exceeding, say, $100,000 per year.
Truncation entails greater information loss than does censoring.
In this lecture, we will focus upon the problem of censored data.19 Once again, we will use the
Tanzanian data for illustrative purposes. However, we will use an artificially modified version
of the data. Specifically, we will imagine that, for purposes of survey anonymity, the Tanzanian
National Bureau of Statistics censored the measure of income at a gross weekly income of 250,000
Tanzanian shillings (i.e. almost exactly £100). Figure 5.1 shows the actual recorded Tanzaian
income distribution (in the top panel), and then the imaginary income distribution with artificial
top-coding (in the bottom panel).
19
Truncated data requires very similar methods, and a similar log-likelihood function.
52 [Link]@[Link]
5.2 The Tobit model
The question for this lecture is simple: how can we estimate the effect of education on earnings
when earnings are censored? For simplicity, we will consider four educational achievements: (i)
no education (i.e. not having completed primary school), (ii) primary education, (iii) secondary ed-
ucation and (iv) tertiary education. Figure 5.2 shows the distribution of (true) gross weekly income
across those four categories, with the top-coding point marked. The figure illustrates immediately
why censorship produces empirical problems: censorship has different effects across the different
educational categories. Thus, for example, only about 12% of income-earning Tanzanians with
no education would be affected by our artificial top-coding; however, the top-coding would affect
almost half of income-Tanzanians with a tertiary education. Figure 5.3 shows the effect on condi-
tional means: top-coding reduces mean measured income by more for those education categories
with higher earnings; if we do not correct for top-coding, we will therefore underestimate the effect
of education.
53 [Link]@[Link]
5.2 The Tobit model
In the actual Tanzanian data, y ∗ is observed, so we can run an OLS regression on equation 5.1 to
estimate the average earnings of individuals with different educational achievements. (Note that
we are not saying anything here about causation: because we are saying nothing about ‘ability
bias’, we are simply seeking here to describe conditional average earnings.)
In our artificial data, however, things are not so simple; recall that, in our artificial data, we are
imagining that earnings is top-coded at a weekly income of 250,000 Tanzanian shillings. In our
artificial data, we therefore observe not y ∗ but y, where we have:
∗
yi if yi∗ < z
yi = (5.2)
z if yi∗ ≥ z,
where z denotes the censorship point (in this case, defined such that z = ln(250000)). Alterna-
tively, equation 5.2 can be rewritten as:
yi = min (yi∗ , z) . (5.3)
As in earlier lectures, we need a distributional assumption on the error term.
Assumption 5.1 (DISTRIBUTION OF ε∗i ) ε∗i is i.i.d. with a normal distribution with mean 0 and
variance σ 2 , independent of Dip , Dis and Dit :
ε∗i | Dip , Dis , Dit ∼ N 0, σ 2 .
(5.4)
54 [Link]@[Link]
5.2 The Tobit model
Figure 5.3: Mean log income by education category, with and without top-coding
For simplicity, we can define µi such that µi | Dip , Dis , Dit ∼ N (0, 1), and write:
yi∗ = α + βp Dip + βs Dis + βt Dit + σ · µi . (5.5)
From this equation, we can derive the log-likelihood. The idea is simple: we can recover consistent
estimates of our parameters of interest if we can write a log-likelihood that jointly models (i) the
income-generating process, and (ii) the process of top-coding. First, we can write the conditional
probability of censorship:20
Pr yi = z | Dip , Dis , Dit = Pr yi∗ ≥ z | Dip , Dis , Dit
(5.6)
p s t
z − (α + βp Di + βs Di + βt Di )
= Pr µi ≥ Dip , Dis , Dit (5.7)
σ
z − (α + βp Dip + βs Dis + βt Dit )
=1−Φ (5.8)
σ
α + βp Dip + βs Dis + βt Dit − z
=Φ . (5.9)
σ
For individuals whose income is not censored, the likelihood is the probability that income is not
censored, multiplied by the conditional density of income (conditional also upon income not being
20
Note that, because µi has a standard normal distribution, the conditional probability of censorship follows a probit
model.
55 [Link]@[Link]
5.3 Back to Tanzania. . .
censored):
(Note that, for any random variable X distributed such that X ∼ N (µ, σ 2 ), the probability density
is f (X; µ, σ 2 ) = σ −1 · φ [(X − µ)/σ].)
We can therefore write the log-likelihood for the ith individual as:
21
Admittedly, the Tobit estimator overestimates the average earnings for the tertiary-educated; however, this difference
is not significant.
56 [Link]@[Link]
5.3 Back to Tanzania. . .
OLS Tobit
z }| { z }| {
Real data Censored data Truncated data Censored data
(1) (2) (3) (4)
Const. 10.786 10.705 10.470 10.776
(0.041)∗∗∗ (0.035)∗∗∗ (0.034)∗∗∗ (0.041)∗∗∗
57 [Link]@[Link]
5.4 The Inverse Mills Ratio
Figure 5.5: Mean log income by education category, dropping top-coded observations
Figure 5.5 shows mean log income across education category, comparing the mean of the true data
to the mean of truncated data. (That is, Figure 5.3 compared the true data to censored data; Figure
5.5 shows the equivalent figure for truncated data. In doing so, the figure summarises the coeffi-
cients in column (3) of Table 5.1.)
Our objective is to derive an expression for the expected heights of the light gray bars in Figure
5.5. To do this, we need to consider a very nice feature of the normal distribution. As you know,
the probability density function of the standard normal is:
2
1 x
φ(x) = √ · exp − . (5.16)
2π 2
58 [Link]@[Link]
5.4 The Inverse Mills Ratio
This is very useful; we can use this result to derive the expectation of a truncated normal distribu-
tion. Suppose that X ∼ N (0, 1). Then we can write:
Z z
x · φ(x) dx
−∞
E(X | X < z) = Z z (5.19)
φ(x) dx
−∞
Z z
dφ(x)
− dx
−∞ dx
= (5.20)
Φ(z)
[φ(x)]z−∞
=− (5.21)
Φ(z)
φ(z)
=− . (5.22)
Φ(z)
Symmetrically, we have:
φ(z)
E(X | X > z) = . (5.23)
1 − Φ(z)
Therefore, we can write the expectation of yi , conditional on covariates and upon ‘no truncation’
as:22
where the final equality follows from our earlier results about the truncated standard normal.
22
Note that equation 5.25 follows from equation 5.24 because we are conditioning on Dip , Dis and Dit ; that is, those
variables are known, and enter linearly, so we can take them outside of the expectation operator.
59 [Link]@[Link]
5.4 The Inverse Mills Ratio
The final term — the Inverse Mills Ratio term — is clearly central to understanding why top-
coding causes us to underestimate the conditional means of education. To see this clearly, we can
write the conditional mean for each level of education separately:
φ ([z − α] · σ −1 )
α −σ· if no education;
Φ ([z − α] · σ −1 )
φ ([z − α − βp ] · σ −1 )
α + β − σ · if primary education;
p
Φ ([z − α − βp ] · σ −1 )
E yi | yi < z, Dp , Ds , Dt =
φ ([z − α − βs ] · σ −1 )
α + β − σ · if secondary education;
s
Φ ([z − α − βs ] · σ −1 )
φ ([z − α − βt ] · σ −1 )
α + βt − σ · if tertiary education.
Φ ([z − α − βt ] · σ −1 )
(5.27)
Figure 5.6 shows the Inverse Mills Ratio function: the function is strictly decreasing, strictly con-
vex, limx→∞ φ(x)/Φ(x) = 0 and limx→−∞ φ(x)/ (x · Φ(x)) = −1. Thus, if the effect of education
is larger (e.g. βp is higher), then the argument to the Invese Mills Ratio will be smaller, the Ratio
will be larger, and the difference between true mean earnings and mean censored earnings will be
greater. This, of course, is precisely what we observed in Figure 5.5.
The Inverse Mills Ratio is therefore useful for understanding the consequences of truncation. (And,
indeed, we could also write a slightly more complicated expression for the conditional expectations
under censorship.) But the Ratio is more important than that; we will see in our next lecture that it
is also fundamental for correcting problems of sample selection.
60 [Link]@[Link]
5.5 A warning
The Tobit model is certainly one structure that is sometimes placed upon data like this. Researchers
sometimes argue, for example, that respondents each have a ‘preferred number of hours worked’
— if that preferred number is greater than zero, respondents work that number of hours; otherwise,
they work zero hours. However, this interpretation is problematic, for at least two reasons. First, as
a matter of principle, we may not find it reasonable to model individuals’ labour supply decision
in this way. For example, we may think that individuals require some effort to find a job, or some
transportation cost of travelling to work — so it may not make sense, say, to model anybody as
working for 10 minutes a week. Second, as matter of empirical observation, many censored or
truncated variables actually have a distribution quite different to that implied by a Tobit structure.
For example, consider the bottom panel of Figure 5.7: this shows the distribution of a simulated
61 [Link]@[Link]
5.6 Appendix to Lecture 5: Stata code
‘hours of work’ variable, where the parameters used are obtained by a Tobit estimation on the true
data (in the top panel). Loosely, we can interpret the bottom panel as saying, “This is what the
distribution of hours should look like, if the underlying process truly is a Tobit model”. It is clear
that the distributions look quite different: for example, the proportion of respondents who do not
work is substantially higher in the real data than in the simulated data. In short, the Tobit model
does not seem to describe this data well — either as a matter of empirical observation or in its
implications about underlying behaviour.
Do Tobit-type latent variables models ever make sense? Yes, if the data you are work-
ing with are truly censored. True censoring means the latent variable has an empirical
counterpart that is the outcome of primary interest. A leading example from labor eco-
nomics is CPS earnings data, which topcodes (censors) very high values of earnings
to protect respondent confidentiality.
Instead of using the Tobit model, it may be more reasonable to consider individuals as making two
labour supply decisions — i.e. (i) whether to work at all and, if so, (ii) how many hours to work.
The Tobit model links those two decisions in a very rigid and very specific way — but it may
be preferable to use a model that treats those two outcomes separately. Such an approach might
fit the data more closely, while also allowing more flexibility in its implications about economic
behaviour. This is the kind of approach that we will consider in our final lecture.
(Note, in interpreting this last line, that exp(12.429) ≈ 250000; that is, the last line is telling Stata
to use 12.429 as the upper limit for censorship of log wages.)
62 [Link]@[Link]
6 Lecture 6: Selection
Required reading:
• ? C AMERON , A.C. AND T RIVEDI , P.K. (2005): Microeconometrics: Methods and Appli-
cations. Cambridge University Press, pages 546 – 553 (i.e. section 16.5)
or
• ? W OOLDRIDGE , J. (2002): Econometric Analysis of Cross Section and Panel Data. The
MIT Press, pages 551 – 566 (i.e. sections 17.1 to 17.4.1, inclusive)
or
• ? W OOLDRIDGE , J. (2010): Econometric Analysis of Cross Section and Panel Data (2nd
ed.). The MIT Press, pages 790 – 808 (i.e. sections 19.3 to 19.6.1, inclusive).
Other references:
• N EWEY, W., J.P OWELL AND [Link] (1990): “Semiparametric Estimation of Selection
Models: Some Empirical Results,” American Economic Review, 80(2), 324–328.
For illustrative purposes, we will begin by considering a simulated dataset. In that simulated data,
students choose years of education x ∈ {1, 20}, and the ith student then has a potential log income
yi∗ , where yi∗ is determined by a standard Mincer earnings equation:
That is, we can interpret yi∗ as an income offer — the income that the ith individual would earn if
that individual were to hold employment. Critically, we will assume that we cannot fully observe
yi∗ : we will assume that the ith individual earns yi∗ only if that individual finds a job. Otherwise,
we will assume that the value for log income is missing (in the sense that log(0) is undefined). As
researchers, we therefore observe not potential log income, yi∗ , but actual log income, yi :
∗
yi if the ith individual has a job;
yi = (6.2)
· if the ith individual does not have a job.
63 [Link]@[Link]
6.2 The Heckman selection model
We will assume that E(ε∗i | xi ) = 0; that is, we will assume that, if we could observe yi∗ , we could
estimate β0 and β1 consistently simply by using OLS. (In reality, of course, we may be concerned
that this assumption does not hold; we might be concerned both about endogenous sample seletion
and about endogenous choice of education. But we will ignore this possibility in this lecture so
that we can focus on the problem of endogenous selection.)
Before we go any further, we must consider a simple question: why does it matter whether an
individual has a job or not? The simplest approach to estimating β0 and β1 would simply be to
regress yi on xi for those individuals who have a job. This would be a valid approach — that is, it
would produce consistent estimates of β0 and β1 — if the individuals with a job were a representa-
tive sample of all individuals in the population. For example, it would be a valid approach if each
individual’s employment status were determined by flipping a coin.
The problem, of course, is that employment is not determined by flipping a coin — and there
are good reasons to believe that the mechanism that determines whether someone has a job is not
independent of the mechanism that determines how much that individual can earn. For example,
it may be that individuals with a higher earning capacity invest more resources in job search;
similarly, it may be that employers are more likely to offer a job to someone who is likely to be
more productive. This is what researchers sometimes term a ‘selection problem’: the individuals
for whom we have data (in this case, individuals with a job) may be an unrepresentative subsample
of the population, because the process by which the sample is chosen depends upon the mechanism
being studied (in this case, the relationship between education and earnings). In this lecture, we
consider a method for recovering consistent estimates of β0 and β1 while allowing for this selection
problem.
Assumption 6.1 The number of children in an individual’s household (zi ) is independent of that
individual’s ‘work ability’ (ε∗i ) and ‘work desire’ (µi ).
Like all assumptions, this is debateable. For example, the assumption rules out the possibility that
individuals with higher ‘work ability’ choose to have fewer children in order to pursue their ca-
reers. I leave it to you to consider how reasonable you find this assumption; it is an assumption
64 [Link]@[Link]
6.2 The Heckman selection model
We will assume that the ith individual’s employment status depends upon (i) his or her education,
xi , (ii) the number of children in his or her household, zi , and (iii) his or her ‘work desire’, µi . We
will denote ji as a dummy variable for whether the ith individual has a job, and will assume:
0 if γ0 + γ1 xi + γ2 zi + µi < 0;
ji = (6.3)
1 if γ0 + γ1 xi + γ2 zi + µi ≥ 0.
(Note, in passing, the similarity between equation 6.3 and our earlier equations 1.6 and 1.7.)
Together, equations 6.1, 6.2 and 6.3 describe what can be termed a ‘triangular simultaneous equa-
tions system’; more generally, we can write the system as:
Critically, note that — because of Assumption 6.1 — zi directly affects ji but does not directly af-
fect yi . That is, zi is excluded from the function y; this assumption is therefore sometimes termed
the ‘exclusion restriction’. In this context, the validity of the exclusion restriction depends criti-
cally upon our assumption that zi and ε∗i are independent; if, for example, individuals with higher
‘work ability’ choose to have fewer children, the exclusion restriction will be violated.
Together, equations 6.4 and 6.5 emphasise the importance of the relationship between ε∗i and µi :
as we noted earlier, it is this relationship that creates the selection problem that our estimator will
need to address. In the Heckman selection model, we proceed by assuming that ε∗i and µi are
drawn from the following bivariate normal distribution, independent of xi and zi :
∗ 2
ε 0 σ ρ·σ
xi , zi ∼ N , . (6.6)
µ 0 ρ·σ 1
In our simulated data, we will set ρ = 0.75 and σ = 1. Figure 6.1 shows the simulated distribution
of (µi , ε∗i ) for a sample of size N = 10000. Additionally, we have zi ∈ {0, . . . , 4}, simulated with
equal probability on each point of support (i.e. a probability of 0.2).
We will derive formal results shortly. But, even before we do this, Figure 6.1 provides an intuitive
illustration of the selection problem. First, note that individuals with a higher value of µi are
more likely to have a job — and that those individuals are also likely to have a higher value of
ε∗i . Moreover, we can see intuitively why the value of ε∗i among individuals with a job is likely
to correlate with individuals’ education. If γ1 > 0, more educated individuals are more likely to
have a job. Therefore, those less educated individuals who have a job will, on average, have a
higher work desire than their more educated workmates; in turn, this implies that they will also
have a higher average work ability. We should therefore expect an OLS regression of yi on xi to
underestimate the effects of schooling. To formalise this, we need to revise some characteristics of
the bivariate normal.
65 [Link]@[Link]
6.2 The Heckman selection model
Equation 6.6 is clearly a special case of 6.7, where the distributional assumption on (µi , εi ) nor-
malises the means of each variable to zero and the variance of µi to 1. Two important results
follow. First, consider the marginal distribution of µi :
µi ∼ N (0, 1). (6.10)
66 [Link]@[Link]
6.2 The Heckman selection model
The ith individual’s employment status is therefore determined by a linear index of xi and zi (see
equation 6.3), plus an error term that has a standard normal distribution: that is, employment status
is determined by a probit model. This implies that we can estimate γ0 , γ1 and γ2 consistently by
running a probit estimation of ji on xi and zi .
ε∗i | µi ∼ N ρσ · µi , (1 − ρ2 ) · σ 2 .
(6.11)
Critically, this implies that the conditional expectation of ε∗i is linear in µi (as Figure 6.1 illustrated):
E(ε∗i | µi ) = ρσ · µi . (6.12)
Consider, then, the conditional expectation of ε∗i for someone who has a job:
This derivation follows our earlier results on the Inverse Mills Ratio (see, for example, equation
5.22). From this result, we can write the conditional expectation of log income, given that an
individual has a job:
φ(γ0 + γ1 xi + γ2 zi )
E(yi | xi , zi , ji = 1; β0 , β1 , γ0 , γ1 , γ2 ) = β0 + β1 xi + ρσ · . (6.17)
Φ(γ0 + γ1 xi + γ2 zi )
This implies that, for the subsample having a job, we can write:
φ(γ0 + γ1 xi + γ2 zi )
yi = β0 + β1 xi + ρσ · + ηi , (6.18)
Φ(γ0 + γ1 xi + γ2 zi )
where E(ηi | xi , zi ) = 0.
This should remind you of our earlier derivation of the Tobit estimator; for this reason, the Heck-
man selection correction model is sometimes known as a ‘Generalised Tobit’ estimator (or a ‘Type
2 Tobit’).
67 [Link]@[Link]
6.2 The Heckman selection model
(i) Run a probit of ji on xi and zi (i.e. for the entire sample). Use the estimates γ̂0 , γ̂1 and γ̂2 to
construct an estimated Inverse Mills Ratio,
φ (γ̂0 + γ̂1 xi + γ̂2 zi )
.
Φ (γ̂0 + γ̂1 xi + γ̂2 zi )
(ii) Run an OLS regression of yi on xi and the estimated Inverse Mills Ratio, for all individuals
who have a job.
As Wooldridge (2002, page 564) explains, “The procedure is sometimes called Heckit after Heck-
man (1976) and the tradition of putting “it” on the end of procedures related to probit (such as
Tobit).” Assuming that all of the model assumptions are correct, this method will yield consistent
estimates of β0 and β1 . The Inverse Mills Ratio term has acted in the OLS regression as a control
for the differences in work ability created by the selection process: for this reason, we can term the
Inverse Mills Ratio function in this context as a ‘control function’. Control function methods are
useful for many different types of applied problems.
The Heckit procedure produces consistent estimates of β0 and β1 , but does not generally produce
consistent estimates of the standard errors, if ρ 6= 0. There are two reasons for this: (i) ρ 6= 0
implies heteroskedasticty, and (ii) γ̂0 , γ̂1 and γ̂2 are estimates of the true γ0 , γ1 and γ2 , so the
estimated Inverse Mills Ratio is a ‘generated regressor’. Fortunately, Stata adjusts the standard
errors to correct these problem (using the ‘heckman ..., twostep’ command). Note that if
we are only interested in testing H0 : ρ = 0, these problems do not arise (i.e. we can trust the the
standard errors from the OLS regression).
To write the log-likelihood, let’s start by turning our earlier logic around. For a given value of ε∗i ,
the marginal distribution of ε∗i is N (0, σ 2 ); the conditional distribution of µi is:
µi | ε∗i ∼ N ρσ −1 · ε∗i , (1 − ρ2 ) .
(6.19)
We can use this expression to write the conditional probability that µi ≥ γ0 + γ1 xi + γ2 zi (i.e. that
the ith individual has a job), for a given value of ε∗i . First, note that equation 6.19 implies:
−µi + ρσ −1 · ε∗i
p ε∗i ∼ N (0, 1) . (6.20)
1−ρ 2
68 [Link]@[Link]
6.2 The Heckman selection model
The probability of a respondent having a job, conditional upon having a ‘work ability’ ε∗i , is there-
fore:
Pr (γ0 + γ1 xi + γ2 zi + µi ≥ 0 | ε∗i )
= Pr (−µi ≤ γ0 + γ1 xi + γ2 zi | ε∗i ) (6.21)
!
−µi + ρσ −1 · ε∗i γ0 + γ1 xi + γ2 zi + ρσ −1 · ε∗i
= Pr p ≤ p ε∗i (6.22)
1 − ρ2 1 − ρ2
!
γ0 + γ1 xi + γ2 zi + ρσ −1 · ε∗i
=Φ p . (6.23)
1 − ρ2
This provides the probability mass of having a job, conditional on an observed value of ε∗i (which
we are terming εi ). Given that the marginal distribution of ε∗i is normal with variance σ 2 , the
marginal probability density of ε∗i is:
−1 yi − β0 − β1 xi
σ ·φ . (6.24)
σ
Therefore, the joint likelihood of observing the ith respondent in a job and of observing that respon-
dent’s particular wage is simply the marginal probability density times the conditional probability
mass:
!
γ0 + γ1 xi + γ2 zi + ρσ −1 · ε∗i
−1 yi − β0 − β1 xi
Φ p ×σ ·φ . (6.25)
1 − ρ2 σ
Thus, for the ith individual, we can write the log-likelihood as:
ln [1 − Φ (γ0 + γ1 xi + γ2 zi )]
if the ith individual has no job, and
`i (·) =
!
−1
γ0 + γ x
1 i + γ z
2 i + ρσ · (y i − β 0 − β x
1 i ) −1 yi − β0 − β1 xi
ln Φ + ln σ · φ
p
σ
1 − ρ 2
if the ith individual has a job at wage yi .
(6.26)
This, it must be said, is quite an intimidating expression — and you will have the opportunity
to revise its derivation as part of the second problem set. The underlying idea, however, should
be clear: we can write the log-likelihood for a selection model by thinking about the marginal
distribution of the observed wage and the probability of employment conditional upon that wage
having been offered.
69 [Link]@[Link]
6.2 The Heckman selection model
However, note that the Heckit estimator did not require the full distributional assumption of equa-
tion 6.7; instead, it required only (i) the standard normal marginal distribution assumption of equa-
tion 6.10 and (ii) the linear conditional expectation assumption of equation 6.12. As in many
econometric contexts, the choice between the Heckit estimator and the maximum likelihood esti-
mator is therefore a choice between an estimator that is more efficient and one that is more robust.
[Maximum likelihood estimation] will be more efficient than the two-step procedure
under joint normality of [µi and εi ], and it will produce standard errors and likelihood
ratio statistics that can be used directly. . . The drawbacks are that it is less robust than
the two-step procedure and that it is sometimes difficult to get the problem to converge.
Cameron and Trivedi make the same point: see pages 550–551.
Figure 6.3 shows the distribution of simulated ε∗i across different levels of education. The dotted
line shows that E(ε∗i | xi ) = 0 (that is, it confirms that OLS would produce consistent estimates of
β0 and β1 if we were able to observe earnings for the entire sample).
Figure 6.4 shows the distribution of simulated εi , i.e. the distribution of ε∗i for individuals with a
job (for simplicity, I now show only individuals having no children in the household: zi = 0). The
conditional expectation is noticeably larger for individuals with less education; as discussed, these
individuals have ‘overcome more’ in order to find a job, and therefore have a higher average work
ability. The smoothed line is given by ρσ times the Inverse Mills Ratio (i.e. as in equation 6.16).
23
Wooldridge actually prefers the term ‘partial’ maximum likelihood here, because the wage does not enter the likeli-
hood unless an individual has a job.
70 [Link]@[Link]
6.2 The Heckman selection model
Figure 6.2: Conditional probability of earning income (simulated data)
71 [Link]@[Link]
6.2 The Heckman selection model
Figure 6.4: Conditional expectation of ε (simulated data, z = 0)
Table 6.1 shows three sets of estimates. Note that the primary object of interest is β1 , the effect of
education upon log earnings. Column 3 reports the OLS estimate: β̂1 = 0.059. OLS substantially
underestimates the effect of education, for the reasons that we have discussed. Columns 1 and 2
report the Heckman estimates; they respectively show the estimates from maximum likelihood and
from the two-step method. The estimates are nearly identical, and both estimate β1 very close to
its true value (β1 = 0.1).
72 [Link]@[Link]
6.2 The Heckman selection model
Heckman OLS
Maximum Likelihood Two-step
(1) (2) (3)
First stage:
γˆ0 (true γ0 = −0.5) -.505 -.509
(0.031)∗∗∗ (0.032)∗∗∗
Second stage:
β̂0 (true β0 = 10.0) 10.041 9.965 10.987
(0.055)∗∗∗ (0.094)∗∗∗ (0.029)∗∗∗
Other parameters:
ρ̂ (true ρ = 0.75) 0.727 0. 768
(0.024)
73 [Link]@[Link]
6.3 An unconvincing alternative (or “How can I find log(0)?”)
In one form or another, almost every applied researcher has had this conversation at some point
in his or her life — yet it is a conversation that is rarely addressed directly by econometrics text-
books. Of course, the problem really has nothing to do with ‘finding the log of zero’; as we have
discussed in this lecture, the problem is that those individuals who do not work are unlikely to be
drawn randomly from our population of interest. This is why we needed to discuss ‘work ability’
and ‘work desire’, and the consequent Heckman selection model.
But there is another approach that deserves a mention, if only because it is reasonably popular: just
ignore the selection problem and instead code the outcome variable as y = log(wage + 1). This
function is almost identical to y = log(wage) for individuals who have a positive wage, but now
allows us to include y = 0 in our estimations for everyone without a job. For example, we could
then estimate the effect of education using a regression of log(wagei + 1) = β0 + β1 xi + ωi .
This is a superficially appealing approach, because we appear to have resolved the entire selection
problem without needing any of the irritations of Heckman’s approach (and, indeed, without need-
ing an exclusion restriction). There is just one problem: it doesn’t work. Figure 6.5 shows why,
using the same simulated example that we have just been examining: because the log(wagei + 1)
transformation combines individuals who have a job with those who do not, the regression es-
timates (shown by the dotted line) conflate two separate effects: (i) the effect of education on
whether an individual has a job, and (ii) the effect of education on the individual’s potential earn-
ings.24 Selection problems should be confronted directly, rather than sidestepped with arbitrary
transformations.25
24
The log(y + 1) transformation produces an estimate β̂1 = 0.430, whereas the true value used for simulation was
β1 = 0.1.
25
The same could be said of several variations on the theme — including, for example, using y = log(wage
p i + κ) for
some arbitrarily chosen κ > 1, and the ‘inverse hyperbolic sine transformation’, y = log(wagei + wage2i + 1).
74 [Link]@[Link]
6.4 Selection in the Tanzanian data
Figure 6.5: Scatter plot of log(wage + 1) against years of education (with jitter)
Of course, these conclusions depend upon our model being correct — and this, of course, includes
the exclusion restriction. I leave you to consider how reasonable these assumptions are.
26
Notice, however, that the standard errors on the Heckman estimates are much larger than the standard errors on
OLS.
75 [Link]@[Link]
6.5 Flexible extensions to the Heckman model
Men Women
z }| { z }| {
OLS Heckman OLS Heckman
(1) (2) (3) (4)
First stage:
Const. -.799 -.967
(0.04)∗∗∗ (0.034)∗∗∗
Second stage:
Const. 10.639 10.835 10.570 9.769
(0.064)∗∗∗ (0.692)∗∗∗ (0.063)∗∗∗ (0.649)∗∗∗
Other:
ρ̂σ̂ -.178 0.524
(0.518) (0.423)
This implies that, instead of equation 6.18, we can write our second stage as a flexible function of
the Inverse Mills Ratio:
φ(γ̂0 + γ̂1 xi + γ̂2 zi )
yi = β0 + β1 xi + g + ηi . (6.28)
Φ(γ̂0 + γ̂1 xi + γ̂2 zi )
76 [Link]@[Link]
6.6 Appendix to Lecture 6: Stata code
Deaton (1997, page 105) notes that the function g can be estimated parametrically — for example,
by using a polynomial specification, such as:
2
φ(γ̂0 + γ̂1 xi + γ̂2 zi ) φ(γ̂0 + γ̂1 xi + γ̂2 zi )
yi = β0 + β1 xi + δ1 · + δ2 ·
Φ(γ̂0 + γ̂1 xi + γ̂2 zi ) Φ(γ̂0 + γ̂1 xi + γ̂2 zi )
3 4
φ(γ̂0 + γ̂1 xi + γ̂2 zi ) φ(γ̂0 + γ̂1 xi + γ̂2 zi )
+ δ3 · + δ4 · + ηi . (6.29)
Φ(γ̂0 + γ̂1 xi + γ̂2 zi ) Φ(γ̂0 + γ̂1 xi + γ̂2 zi )
This specification nests the two-step estimator of equation 6.18 for the special case that δ1 = ρσ
and δ2 = δ3 = δ4 = 0. Alternatively, we could estimate equation 6.28 semiparametrically, as a
‘partial linear model’ — as in, for example, Newey, Powell and Walker (1990).
Having cleared the memory and loaded our data, we can implement the Heckman model using the
command ‘heckman’; we choose the two-step estimator by adding the option ‘twostep’. We
can therefore run the following:
77 [Link]@[Link]