Vous êtes sur la page 1sur 37

BINARY CHOICE MODELS: LOGIT ANALYSIS

Y, p

1
1 - 1 - 2Xi

1 + 2Xi
1

1 + 2Xi
B

Xi

The linear probability model may make the nonsense predictions that an event will occur
with probability greater than 1 or less than 0.
1

BINARY CHOICE MODELS: LOGIT ANALYSIS


1.00

F (Z )

1
p F(Z )
1 e Z

0.75

0.50

Z 1 2 X
0.25

0.00
-8

-6

-4

-2

The usual way of avoiding this problem is to hypothesize that the probability is a sigmoid
(S-shaped) function of Z, F(Z), where Z is a function of the explanatory variables.
2

BINARY CHOICE MODELS: LOGIT ANALYSIS


1.00

F (Z )

1
p F(Z )
1 e Z

0.75

0.50

Z 1 2 X
0.25

0.00
-8

-6

-4

-2

Several mathematical functions are sigmoid in character. One is the logistic function
shown here. As Z goes to infinity, e-Z goes to 0 and p goes to 1 (but cannot exceed 1). As Z
goes to minus infinity, e-Z goes to infinity and p goes to 0 (but cannot be below 0).
3

BINARY CHOICE MODELS: LOGIT ANALYSIS


1.00

F (Z )

1
p F(Z )
1 e Z

0.75

0.50

Z 1 2 X
0.25

0.00
-8

-6

-4

-2

The model implies that, for values of Z less than -2, the probability of the event occurring is
low and insensitive to variations in Z. Likewise, for values greater than 2, the probability is
high and insensitive to variations in Z.
4

BINARY CHOICE MODELS: LOGIT ANALYSIS

U
Y
V

1
p F(Z )
1 e Z
Z

dp (1 e ) 0 1 ( e

dZ
(1 e Z ) 2
e Z

(1 e Z ) 2

dY

dZ

dU
dV
U
dZ
dZ
V2

U 1

dU
0
dZ

V (1 e Z )
dV

e Z
dZ
To obtain an expression for the sensitivity, we differentiate F(Z) with respect to Z. The box
gives the general rule for differentiating a quotient and applies it to F(Z).
5

BINARY CHOICE MODELS: LOGIT ANALYSIS

F (Z )

dp
e Z
f (Z )

dZ (1 e Z ) 2

1
p F(Z )
1 e Z

0.2

0.1

0
-8

-6

-4

-2

The sensitivity, as measured by the slope, is greatest when Z is 0. The marginal function,
f(Z), reaches a maximum at this point.
6

BINARY CHOICE MODELS: LOGIT ANALYSIS


1.00

F (Z )

1
p F(Z )
1 e Z

0.75

0.50

Z 1 2 X
0.25

0.00
-8

-6

-4

-2

For a nonlinear model of this kind, maximum likelihood estimation is much superior to the
use of the least squares principle for estimating the parameters. More details concerning
its application are given at the end of this sequence.
7

BINARY CHOICE MODELS: LOGIT ANALYSIS


1.00

F (Z )

1
p F(Z )
1 e Z

0.75

0.50

Z 1 2 ASVABC
0.25

0.00
-8

-6

-4

-2

We will apply this model to the graduating from high school example described in the linear
probability model sequence. We will begin by assuming that ASVABC is the only relevant
explanatory variable, so Z is a simple function of it.
8

BINARY CHOICE MODELS: LOGIT ANALYSIS


. logit GRAD ASVABC
Iteration
Iteration
Iteration
Iteration
Iteration
Iteration

0:
1:
2:
3:
4:
5:

Log
Log
Log
Log
Log
Log

Likelihood
Likelihood
Likelihood
Likelihood
Likelihood
Likelihood

Logit Estimates
Log Likelihood = -117.35135

=-162.29468
=-132.97646
=-117.99291
=-117.36084
=-117.35136
=-117.35135
Number of obs
chi2(1)
Prob > chi2
Pseudo R2

=
570
= 89.89
= 0.0000
= 0.2769

-----------------------------------------------------------------------------grad |
Coef.
Std. Err.
z
P>|z|
[95% Conf. Interval]
---------+-------------------------------------------------------------------asvabc |
.1666022
.0211265
7.886
0.000
.1251951
.2080094
_cons | -5.003779
.8649213
-5.785
0.000
-6.698993
-3.308564
------------------------------------------------------------------------------

The Stata command is logit, followed by the outcome variable and the explanatory
variable(s). Maximum likelihood estimation is an iterative process, so the first part of the
output will be like that shown.
9

BINARY CHOICE MODELS: LOGIT ANALYSIS


. logit GRAD ASVABC
Iteration
Iteration
Iteration
Iteration
Iteration
Iteration

0:
1:
2:
3:
4:
5:

Log
Log
Log
Log
Log
Log

Likelihood
Likelihood
Likelihood
Likelihood
Likelihood
Likelihood

=-162.29468
=-132.97646
=-117.99291
=-117.36084
=-117.35136
=-117.35135

Logit Estimates
Log Likelihood = -117.35135

Number of obs
chi2(1)
Prob > chi2
Pseudo R2

=
570
= 89.89
= 0.0000
= 0.2769

-----------------------------------------------------------------------------GRAD |
Coef.
Std. Err.
z
P>|z|
[95% Conf. Interval]
---------+-------------------------------------------------------------------ASVABC |
.1666022
.0211265
7.886
0.000
.1251951
.2080094
_cons | -5.003779
.8649213
-5.785
0.000
-6.698993
-3.308564
------------------------------------------------------------------------------

Z 5.004 0.167 ASVABC


In this case the coefficients of the Z function are as shown.

10

BINARY CHOICE MODELS: LOGIT ANALYSIS


1.00

Cumulative effect

0.75

1 e

5.0040.167 ASVABC i

0.04

0.03
0.50
0.02

0.25

Marginal effect

pi

0.01

0.00

0
0

20

40

60

80

100

ASVABC

Z 5.004 0.167 ASVABC


Since there is only one explanatory variable, we can draw the probability function and
marginal effect function as functions of ASVABC.
11

BINARY CHOICE MODELS: LOGIT ANALYSIS


1.00

Cumulative effect

0.75

1 e

5.0040.167 ASVABC i

0.04

0.03
0.50
0.02

0.25

Marginal effect

pi

0.01

0.00

0
0

20

40

60

80

100

ASVABC

Z 5.004 0.167 ASVABC


We see that ASVABC has its greatest effect on graduating when it is in the range 20-40, that
is, in the lower ability range. Any individual with a score above the average (50) is almost
certain to graduate.
12

BINARY CHOICE MODELS: LOGIT ANALYSIS


. logit GRAD ASVABC
Iteration
Iteration
Iteration
Iteration
Iteration
Iteration

0:
1:
2:
3:
4:
5:

Log
Log
Log
Log
Log
Log

Likelihood
Likelihood
Likelihood
Likelihood
Likelihood
Likelihood

=-162.29468
=-132.97646
=-117.99291
=-117.36084
=-117.35136
=-117.35135

Logit Estimates
Log Likelihood = -117.35135

Number of obs
chi2(1)
Prob > chi2
Pseudo R2

=
570
= 89.89
= 0.0000
= 0.2769

-----------------------------------------------------------------------------GRAD |
Coef.
Std. Err.
z
P>|z|
[95% Conf. Interval]
---------+-------------------------------------------------------------------ASVABC |
.1666022
.0211265
7.886
0.000
.1251951
.2080094
_cons | -5.003779
.8649213
-5.785
0.000
-6.698993
-3.308564
------------------------------------------------------------------------------

Z 5.004 0.167 ASVABC


The t statistic indicates that the effect of variations in ASVABC on the probability of
graduating from high school is highly significant.
13

BINARY CHOICE MODELS: LOGIT ANALYSIS


. logit GRAD ASVABC
Iteration
Iteration
Iteration
Iteration
Iteration
Iteration

0:
1:
2:
3:
4:
5:

Log
Log
Log
Log
Log
Log

Likelihood
Likelihood
Likelihood
Likelihood
Likelihood
Likelihood

=-162.29468
=-132.97646
=-117.99291
=-117.36084
=-117.35136
=-117.35135

Logit Estimates
Log Likelihood = -117.35135

Number of obs
chi2(1)
Prob > chi2
Pseudo R2

=
570
= 89.89
= 0.0000
= 0.2769

-----------------------------------------------------------------------------GRAD |
Coef.
Std. Err.
z
P>|z|
[95% Conf. Interval]
---------+-------------------------------------------------------------------ASVABC |
.1666022
.0211265
7.886
0.000
.1251951
.2080094
_cons | -5.003779
.8649213
-5.785
0.000
-6.698993
-3.308564
------------------------------------------------------------------------------

Z 5.004 0.167 ASVABC


Strictly speaking, the t statistic is valid only for large samples, so the normal distribution is
the reference distribution. For this reason the statistic is denoted z in the Stata output.
This z has nothing to do with our Z function.
14

BINARY CHOICE MODELS: LOGIT ANALYSIS


1.00

Cumulative effect

0.75

1 e

5.0040.167 ASVABC i

0.04

0.03
0.50
0.02

0.25

Marginal effect

pi

0.01

0.00

0
0

20

40

60

80

100

ASVABC

Z 5.004 0.167 ASVABC


The coefficients of the Z function do not have any direct intuitive interpretation.

15

BINARY CHOICE MODELS: LOGIT ANALYSIS

1
p F(Z )
1 e Z
Z 1 2 X 2 ... k X k

However, we can use them to quantify the marginal effect of a change in ASVABC on the
probability of graduating. We will do this theoretically for the general case where Z is a
function of several explanatory variables.
16

BINARY CHOICE MODELS: LOGIT ANALYSIS

1
p F(Z )
1 e Z
Z 1 2 X 2 ... k X k

p dp Z
e Z

f ( Z ) i
i
Z 2
X i dZ X i
(1 e )

Since p is a function of Z, and Z is a function of the X variables, the marginal effect of Xi on


p can be written as the product of the marginal effect of Z on p and the marginal effect of Xi
on Z.
17

BINARY CHOICE MODELS: LOGIT ANALYSIS

1
p F(Z )
1 e Z
Z 1 2 X 2 ... k X k
dp
e Z
f (Z )

dZ (1 e Z ) 2
p dp Z
e Z

f ( Z ) i
i
Z 2
X i dZ X i
(1 e )

We have already derived an expression for dp/dZ. The marginal effect of Xi on Z is given by
its coefficient.

18

BINARY CHOICE MODELS: LOGIT ANALYSIS

1
p F(Z )
1 e Z
Z 1 2 X 2 ... k X k
dp
e Z
f (Z )

dZ (1 e Z ) 2
p dp Z
e Z

f ( Z ) i
i
Z 2
X i dZ X i
(1 e )

Hence we obtain an expression for the marginal effect of Xi on p.

19

BINARY CHOICE MODELS: LOGIT ANALYSIS

1
p F(Z )
1 e Z
Z 1 2 X 2 ... k X k
dp
e Z
f (Z )

dZ (1 e Z ) 2
p dp Z
e Z

f ( Z ) i
i
Z 2
X i dZ X i
(1 e )

The marginal effect is not constant because it depends on the value of Z, which in turn
depends on the values of the explanatory variables. A common procedure is to evaluate it
for the sample means of the explanatory variables.
20

BINARY CHOICE MODELS: LOGIT ANALYSIS


. sum GRAD ASVABC
Variable |
Obs
Mean
Std. Dev.
Min
Max
---------+----------------------------------------------------GRAD |
570
.9175439
.2753
0
1
ASVABC |
570
50.15088
9.214589
22
65

Logit Estimates
Log Likelihood = -117.35135

Number of obs
chi2(1)
Prob > chi2
Pseudo R2

=
570
= 89.89
= 0.0000
= 0.2769

-----------------------------------------------------------------------------GRAD |
Coef.
Std. Err.
z
P>|z|
[95% Conf. Interval]
---------+-------------------------------------------------------------------ASVABC |
.1666022
.0211265
7.886
0.000
.1251951
.2080094
_cons | -5.003779
.8649213
-5.785
0.000
-6.698993
-3.308564
------------------------------------------------------------------------------

The sample mean of ASVABC was 50.15.

21

BINARY CHOICE MODELS: LOGIT ANALYSIS


. sum GRAD ASVABC
Variable |
Obs
Mean
Std. Dev.
Min
Max
---------+----------------------------------------------------GRAD |
570
.9175439
.2753
0
1
ASVABC |
570
50.15088
9.214589
22
65

Z 1 2 X 5.004 0.167 50.15 3.371


Logit Estimates
Log Likelihood = -117.35135

Number of obs
chi2(1)
Prob > chi2
Pseudo R2

=
570
= 89.89
= 0.0000
= 0.2769

-----------------------------------------------------------------------------GRAD |
Coef.
Std. Err.
z
P>|z|
[95% Conf. Interval]
---------+-------------------------------------------------------------------ASVABC |
.1666022
.0211265
7.886
0.000
.1251951
.2080094
_cons | -5.003779
.8649213
-5.785
0.000
-6.698993
-3.308564
------------------------------------------------------------------------------

When evaluated at the mean, Z is equal to 3.371.

22

BINARY CHOICE MODELS: LOGIT ANALYSIS


. sum GRAD ASVABC
Variable |
Obs
Mean
Std. Dev.
Min
Max
---------+----------------------------------------------------GRAD |
570
.9175439
.2753
0
1
ASVABC |
570
50.15088
9.214589
22
65

Z 1 2 X 5.004 0.167 50.15 3.371


e Z e 3.371 0.034

dp
e Z
0.034
f (Z )

0.032
Z 2
2
dZ (1 e )
(1 0.034)

e-Z is 0.034. Hence f(Z) is 0.032.

23

BINARY CHOICE MODELS: LOGIT ANALYSIS


. sum GRAD ASVABC
Variable |
Obs
Mean
Std. Dev.
Min
Max
---------+----------------------------------------------------GRAD |
570
.9175439
.2753
0
1
ASVABC |
570
50.15088
9.214589
22
65

Z 1 2 X 5.004 0.167 50.15 3.371


e Z e 3.371 0.034

dp
e Z
0.034
f (Z )

0.032
Z 2
2
dZ (1 e )
(1 0.034)
p dp Z

f ( Z ) i 0.032 0.167 0.005


X i dZ X i
The marginal effect, evaluated at the mean, is therefore 0.005. This implies that a one point
increase in ASVABC would increase the probability of graduating from high school by 0.5
percent.
24

BINARY CHOICE MODELS: LOGIT ANALYSIS


1.00
0.04

0.03
0.50
0.02

0.25

Marginal effect

Cumulative effect

0.75

0.01

0.00

0
0

20

40

50.15

60

80

100

ASVABC

In this example, the marginal effect at the mean of ASVABC is very low. The reason is that
anyone with an average score is very likely to graduate anyway. So an increase in the score
has little effect.
25

BINARY CHOICE MODELS: LOGIT ANALYSIS


. sum COLLEGE ASVABC
Variable |
Obs
Mean
Std. Dev.
Min
Max
---------+----------------------------------------------------COLLEGE |
570
.4964912
.5004269
0
1
ASVABC |
570
50.15088
9.214589
22
65

Z 1 2 X 5.004 0.167 30 0.006


e Z e 0.006 0.994

dp
e Z
0.994
f (Z )

0.250
Z 2
2
dZ (1 e )
(1 0.994)
p dp Z

f ( Z ) i 0.250 0.167 0.042


X i dZ X i
To show that the marginal effect varies, we will also calculate it for ASVABC equal to 30. A
one point increase in ASVABC then increases the probability by 4.2 percent.
26

BINARY CHOICE MODELS: LOGIT ANALYSIS


1.00
0.89

0.042
0.04

0.03
0.50
0.02

0.25

Marginal effect

Cumulative effect

0.75

0.01

0.00

0
0

20

30

40

60

80

100

ASVABC

An individual with a score of 30 has only a 50 percent probability of graduating, and an


increase in the score has a relatively large impact.
27

BINARY CHOICE MODELS: LOGIT ANALYSIS


. logit GRAD ASVABC SM SF MALE
Iteration
Iteration
Iteration
Iteration
Iteration
Iteration

0:
1:
2:
3:
4:
5:

Log
Log
Log
Log
Log
Log

Likelihood
Likelihood
Likelihood
Likelihood
Likelihood
Likelihood

Logit Estimates
Log Likelihood = -116.49968

=-162.29468
=-133.21451
=-117.16714
=-116.51081
=-116.49969
=-116.49968
Number of obs
chi2(4)
Prob > chi2
Pseudo R2

=
570
= 91.59
= 0.0000
= 0.2822

-----------------------------------------------------------------------------grad |
Coef.
Std. Err.
z
P>|z|
[95% Conf. Interval]
---------+-------------------------------------------------------------------ASVABC |
.1563271
.0224382
6.967
0.000
.1123491
.2003051
SM |
.0645542
.0773804
0.834
0.404
-.0871086
.216217
SF |
.0054552
.0616822
0.088
0.930
-.1154397
.12635
MALE | -.2790915
.3601689
-0.775
0.438
-.9850095
.4268265
_cons |
-5.15931
.994783
-5.186
0.000
-7.109049
-3.209571
------------------------------------------------------------------------------

Here is the output for a model with a somewhat better specification.

28

BINARY CHOICE MODELS: LOGIT ANALYSIS


. sum GRAD ASVABC SM SF MALE
Variable |
Obs
Mean
Std. Dev.
Min
Max
---------+----------------------------------------------------GRAD |
570
.9175439
.2753
0
1
ASVABC |
570
50.15088
9.214589
22
65
SM |
570
11.65263
2.561449
0
20
SF |
570
11.81754
3.533178
0
20
MALE |
570
.5701754
.4954857
0
1

We will estimate the marginal effects, putting all the explanatory variables equal to their
sample means.
29

BINARY CHOICE MODELS: LOGIT ANALYSIS


Logit: Marginal Effects
mean

product

f(Z)

f(Z)b

ASVABC

50.15

0.156

7.839

0.033

0.005

SM

11.65

0.065

0.753

0.033

0.002

SF

11.82

0.006

0.065

0.033

0.000

MALE

0.57

-0.279

-0.159

0.033

-0.009

Constant

1.00

-5.159

-5.159

Total

Z 1 2 X 2 ... k X k
3.338

3.338

The first step is to calculate Z, when the X variables are equal to their sample means.

30

BINARY CHOICE MODELS: LOGIT ANALYSIS


Logit: Marginal Effects
mean

product

f(Z)

f(Z)b

ASVABC

50.15

0.156

7.839

0.033

0.005

SM

11.65

0.065

0.753

0.033
Z

0.002
3.338

SF

11.82

0.006

0.065

MALE

0.57

-0.279

-0.159

Constant

1.00

-5.159

-5.159

Total

.036

Z
e 0.000
f (Z )
0.033
Z 2
e )
0.033 (1 -0.009

0.033

3.338

We then calculate f(Z).

31

BINARY CHOICE MODELS: LOGIT ANALYSIS


Logit: Marginal Effects
mean

product

f(Z)

f(Z)b

ASVABC

50.15

0.156

7.839

0.033

0.005

SM

11.65

0.065

0.753

0.033

0.002

SF

11.82

0.006

0.065

0.033

0.000

MALE

0.57

-0.279

-0.159

0.033

-0.009

Constant

1.00

-5.159

-5.159

Total

-3.338

p dp Z

f ( Z ) i
X i dZ X i

The estimated marginal effects are f(Z) multiplied by the respective coefficients. We see
that the effect of ASVABC is about the same as before. Every extra year of schooling of the
mother increases the probability of graduating by 0.2 percent.
32

BINARY CHOICE MODELS: LOGIT ANALYSIS


Logit: Marginal Effects
mean

product

f(Z)

f(Z)b

ASVABC

50.15

0.156

7.839

0.033

0.005

SM

11.65

0.065

0.753

0.033

0.002

SF

11.82

0.006

0.065

0.033

0.000

MALE

0.57

-0.279

-0.159

0.033

-0.009

Constant

1.00

-5.159

-5.159

Total

-3.338

p dp Z

f ( Z ) i
X i dZ X i

Father's schooling has no discernible effect. Males have 0.9 percent lower probability of
graduating than females. These effects would all have been larger if they had been
evaluated at a lower ASVABC score.
33

BINARY CHOICE MODELS: LOGIT ANALYSIS

1
p F (Z )
1 e Z
1

1 e 1 2 ASVABC

Z 1 2 ASVABC

Individuals who graduated: outcome probability is


1
1 e 1 2 ASVABC i

This sequence will conclude with an outline explanation of how the model is fitted using
maximum likelihood estimation.
34

BINARY CHOICE MODELS: LOGIT ANALYSIS

1
p F (Z )
1 e Z
1

1 e 1 2 ASVABC

Z 1 2 ASVABC

Individuals who graduated: outcome probability is


1
1 e 1 2 ASVABC i

In the case of an individual who graduated, the probability of that outcome is F(Z). We will
give subscripts 1, ..., s to the individuals who graduated.
35

BINARY CHOICE MODELS: LOGIT ANALYSIS

Maximize F(Z1) x ... x F(Zs) x [1 - F(Zs+1)] x ... x [1 - F(Zn)]

Individuals who graduated: outcome probability is


1
1 e 1 2 ASVABC i
Individuals did not graduate: outcome probability is
1

1
1 e 1 2 ASVABC i

In the case of an individual who did not graduate, the probability of that outcome is 1 - F(Z).
We will give subscripts s+1, ..., n to these individuals.
36

BINARY CHOICE MODELS: LOGIT ANALYSIS

Maximize F(Z1) x ... x F(Zs) x [1 - F(Zs+1)] x ... x [1 - F(Zn)]


1
b1 b2 ASVABC 1

...

1 e
1 e b1 b2 ASVABC s
1
1

...

b1 b2 ASVABC s 1
b1 b2 ASVABC n
1 e
1 e

Did graduate
1
1 e

1 2 ASVABC i

Did not graduate


1

1
1 e 1 2 ASVABC i

We choose b1 and b2 so as to maximize the joint probability of the outcomes, that is, F(Z1)
x ... x F(Zs) x [1 - F(Zs+1)] x ... x [1 - F(Zn)]. There are no mathematical formulae for b1 and b2.
They have to be determined iteratively by a trial-and-error process.
37

Vous aimerez peut-être aussi