econometrics ii tutorial no. 2 - github pages · 2020. 11. 10. · summary extra topics lecture...

80
Summary Extra Topics Lecture Problems Problem on logit models Computer Exercise Econometrics II Tutorial No. 2 Lennart Hoogerheide & Agnieszka Borowska 22.02.2017 L. Hoogerheide & A. Borowska Econometrics II: Tutorial No. 2 22.02.2017 1 / 75

Upload: others

Post on 08-Mar-2021

1 views

Category:

Documents


0 download

TRANSCRIPT

Page 1: Econometrics II Tutorial No. 2 - GitHub Pages · 2020. 11. 10. · Summary Extra Topics Lecture ProblemsProblem on logit models Computer Exercise Outline 1 Summary 2 Extra Topics

Summary Extra Topics Lecture Problems Problem on logit models Computer Exercise

Econometrics IITutorial No. 2

Lennart Hoogerheide & Agnieszka Borowska

22.02.2017

L. Hoogerheide & A. Borowska Econometrics II: Tutorial No. 2 22.02.2017 1 / 75

Page 2: Econometrics II Tutorial No. 2 - GitHub Pages · 2020. 11. 10. · Summary Extra Topics Lecture ProblemsProblem on logit models Computer Exercise Outline 1 Summary 2 Extra Topics

Summary Extra Topics Lecture Problems Problem on logit models Computer Exercise

Outline

1 Summary

2 Extra Topics – from last weekThe Perfect Classifier ProblemSimulation from the latent variable model

3 Lecture Problems

4 Problem on binary, ordered & multinomial logit models

5 Computer Exercise

L. Hoogerheide & A. Borowska Econometrics II: Tutorial No. 2 22.02.2017 2 / 75

Page 3: Econometrics II Tutorial No. 2 - GitHub Pages · 2020. 11. 10. · Summary Extra Topics Lecture ProblemsProblem on logit models Computer Exercise Outline 1 Summary 2 Extra Topics

Summary Extra Topics Lecture Problems Problem on logit models Computer Exercise

Summary

L. Hoogerheide & A. Borowska Econometrics II: Tutorial No. 2 22.02.2017 3 / 75

Page 4: Econometrics II Tutorial No. 2 - GitHub Pages · 2020. 11. 10. · Summary Extra Topics Lecture ProblemsProblem on logit models Computer Exercise Outline 1 Summary 2 Extra Topics

Summary Extra Topics Lecture Problems Problem on logit models Computer Exercise

Key terms

Multinomial data: dependent variable can attain mpossible outcomes (yi ∈ {0, 1, . . . ,m− 1}).Ordered and unordered variables: variables with orwithout a natural ordering.[ordered: e.g. education level, job category; unordered: e.g.means of transport]

L. Hoogerheide & A. Borowska Econometrics II: Tutorial No. 2 22.02.2017 3 / 75

Page 5: Econometrics II Tutorial No. 2 - GitHub Pages · 2020. 11. 10. · Summary Extra Topics Lecture ProblemsProblem on logit models Computer Exercise Outline 1 Summary 2 Extra Topics

Summary Extra Topics Lecture Problems Problem on logit models Computer Exercise

Key terms – cont’d

Ordered response model: a model where the categoricaloutcome yi is related to the latent variable

y∗i = x′iβ + ei, ei ∼ IID(0, 1)

by means of m− 1 unknown threshold valuesτ1 < · · · < τm−1 as follows

yi =

0 if −∞ < y∗i ≤ τ1,j if τj < y∗i ≤ τj+1, j = 1, . . . ,m− 2,

m− 1 if τm−1 < y∗i <∞

(k +m− 2 parameters, no constant term in β which hask − 1 elements).

L. Hoogerheide & A. Borowska Econometrics II: Tutorial No. 2 22.02.2017 4 / 75

Page 6: Econometrics II Tutorial No. 2 - GitHub Pages · 2020. 11. 10. · Summary Extra Topics Lecture ProblemsProblem on logit models Computer Exercise Outline 1 Summary 2 Extra Topics

Summary Extra Topics Lecture Problems Problem on logit models Computer Exercise

Key terms – cont’d

Ordered response model: (cont’d) The probability ofchoosing the alternative j:

pij = P[yi = j]

= P[τj < y∗i ≤ τj+1]

= P[y∗i ≤ τj+1]− P[y∗i ≤ τj ]= G(τj+1)−G(τj),

where τ0 = −∞ and τm =∞.

Depending on G(·), the distribution of ei, we have theordered probit (G(·) = Φ(·)) or logit (G(·) = Λ(·)) model.

L. Hoogerheide & A. Borowska Econometrics II: Tutorial No. 2 22.02.2017 5 / 75

Page 7: Econometrics II Tutorial No. 2 - GitHub Pages · 2020. 11. 10. · Summary Extra Topics Lecture ProblemsProblem on logit models Computer Exercise Outline 1 Summary 2 Extra Topics

Summary Extra Topics Lecture Problems Problem on logit models Computer Exercise

Key terms – cont’d

Multinomial logit:

pij =exp(x′iβj)∑mh=1 exp(x′iβh)

=exp(x′iβj)

1 +∑m

h=2 exp(x′iβh)

⇒ individual-specific data.

Conditional logit:

pij =exp(x′iβ))∑mh=1 exp(x′iβ)

⇒ alternative-specific data.

L. Hoogerheide & A. Borowska Econometrics II: Tutorial No. 2 22.02.2017 6 / 75

Page 8: Econometrics II Tutorial No. 2 - GitHub Pages · 2020. 11. 10. · Summary Extra Topics Lecture ProblemsProblem on logit models Computer Exercise Outline 1 Summary 2 Extra Topics

Summary Extra Topics Lecture Problems Problem on logit models Computer Exercise

Key terms – cont’d

Marginal effects of explanatory variables:(in multinomial logit model) all the parametersβ1, . . . , βm−1 together determine the marginal effect of xion the probability to choose the jth alternative. So the

sign of the parameter β(j)l cannot always be interpreted

directly as the sign of the effect of the xl on theprobability to choose the jth alternative.

Odds ratio: the relative odds to choose between thealternatives j and h, given by (in multinomial logit):

P(yi = j|xi)P(yi = h|xi)

= exp(x′i(β

(j) − β(h))).

Then: (β(j)l − β

(h)l ) > 0 indicates a positive effect of xli on

P(yi = j|xi) relative to P(yi = h|xi).L. Hoogerheide & A. Borowska Econometrics II: Tutorial No. 2 22.02.2017 7 / 75

Page 9: Econometrics II Tutorial No. 2 - GitHub Pages · 2020. 11. 10. · Summary Extra Topics Lecture ProblemsProblem on logit models Computer Exercise Outline 1 Summary 2 Extra Topics

Summary Extra Topics Lecture Problems Problem on logit models Computer Exercise

Key terms – cont’d

Utilities Model: A model where the observed dependentvariable is assumed to be a function of utilities experienced

from alternative choices, U(j)i , j = 0, 1, . . . ,m. The

observed choice depends on the difference in the utilities.[interpretation of multinomial/binary logit/probit modelalternative to the latent variables model]

(Cf. from last week) Latent Variable Model: A modelwhere the observed dependent variable is assumed to be afunction of an underlying latent, or unobserved, variable.[interpretation of binary logit/probit model]

L. Hoogerheide & A. Borowska Econometrics II: Tutorial No. 2 22.02.2017 8 / 75

Page 10: Econometrics II Tutorial No. 2 - GitHub Pages · 2020. 11. 10. · Summary Extra Topics Lecture ProblemsProblem on logit models Computer Exercise Outline 1 Summary 2 Extra Topics

Summary Extra Topics Lecture Problems Problem on logit models Computer Exercise

Key terms – cont’d

Multinomial logit: 3 categories case (the jth variable)

L. Hoogerheide & A. Borowska Econometrics II: Tutorial No. 2 22.02.2017 9 / 75

Page 11: Econometrics II Tutorial No. 2 - GitHub Pages · 2020. 11. 10. · Summary Extra Topics Lecture ProblemsProblem on logit models Computer Exercise Outline 1 Summary 2 Extra Topics

Summary Extra Topics Lecture Problems Problem on logit models Computer Exercise

Key terms – cont’d

Standard extreme value distribution:

G(x) = exp(− exp(−x)), (CDF)

p(x) = exp(− exp(−x)− x). (PDF)

The difference between two independent variables with(standard) extreme value distribution has (standard)logistic distribution⇒ used in defining of binary logit model in terms ofutilities.

L. Hoogerheide & A. Borowska Econometrics II: Tutorial No. 2 22.02.2017 10 / 75

Page 12: Econometrics II Tutorial No. 2 - GitHub Pages · 2020. 11. 10. · Summary Extra Topics Lecture ProblemsProblem on logit models Computer Exercise Outline 1 Summary 2 Extra Topics

Summary Extra Topics Lecture Problems Problem on logit models Computer Exercise

Extra Topics – from last week

L. Hoogerheide & A. Borowska Econometrics II: Tutorial No. 2 22.02.2017 11 / 75

Page 13: Econometrics II Tutorial No. 2 - GitHub Pages · 2020. 11. 10. · Summary Extra Topics Lecture ProblemsProblem on logit models Computer Exercise Outline 1 Summary 2 Extra Topics

Summary Extra Topics Lecture Problems Problem on logit models Computer Exercise

The Perfect Classifier Problem

Recall – the loglikelihood:

lnL(β) = ln p(y1, . . . , yn|x1, . . . , xn)

=

n∑i=1

{yi ln[G(x′iβ)]︸ ︷︷ ︸

(∗)

+ (1− yi) ln[1−G(x′iβ)]︸ ︷︷ ︸(∗∗)

}. (1)

We have0 < G(x′iβ) < 1,

hence−∞ < ln[G(x′iβ)] < 0.

L. Hoogerheide & A. Borowska Econometrics II: Tutorial No. 2 22.02.2017 11 / 75

Page 14: Econometrics II Tutorial No. 2 - GitHub Pages · 2020. 11. 10. · Summary Extra Topics Lecture ProblemsProblem on logit models Computer Exercise Outline 1 Summary 2 Extra Topics

Summary Extra Topics Lecture Problems Problem on logit models Computer Exercise

Notice that

yi = 1⇒ (∗) < 0 & (∗∗) = 0,

yi = 0⇒ (∗) = 0 & (∗∗) < 0.

Perfect fit:

yi = 1 ⇐⇒ G(x′iβ) = 1,

yi = 0 ⇐⇒ G(x′iβ) = 0.

This could happen only when

yi = 1 ⇐⇒ x′iβ =∞, (2)

yi = 0 ⇐⇒ x′iβ = −∞. (3)

We say that the loglikelihood (1) is bounded above by 0, and itachieves this bound if (2) and (3) hold.

L. Hoogerheide & A. Borowska Econometrics II: Tutorial No. 2 22.02.2017 12 / 75

Page 15: Econometrics II Tutorial No. 2 - GitHub Pages · 2020. 11. 10. · Summary Extra Topics Lecture ProblemsProblem on logit models Computer Exercise Outline 1 Summary 2 Extra Topics

Summary Extra Topics Lecture Problems Problem on logit models Computer Exercise

Now, suppose that there is some linear combination of theindependent variables, say x′iβ

•, such that

yi = 1 ⇐⇒ x′iβ• > 0, (4)

yi = 0 ⇐⇒ x′iβ• < 0. (5)

In other words, there is some range of the regressor(s) for whichyi is always 1 or 0.

L. Hoogerheide & A. Borowska Econometrics II: Tutorial No. 2 22.02.2017 13 / 75

Page 16: Econometrics II Tutorial No. 2 - GitHub Pages · 2020. 11. 10. · Summary Extra Topics Lecture ProblemsProblem on logit models Computer Exercise Outline 1 Summary 2 Extra Topics

Summary Extra Topics Lecture Problems Problem on logit models Computer Exercise

Then, we say that x′iβ• describes a separating hyperplane

(see Figure 2.1) and there is complete separation of the data.

x′iβ• is said to be a perfect classifier, since it allows us to

predict yi with perfect accuracy for every observation.

L. Hoogerheide & A. Borowska Econometrics II: Tutorial No. 2 22.02.2017 14 / 75

Page 17: Econometrics II Tutorial No. 2 - GitHub Pages · 2020. 11. 10. · Summary Extra Topics Lecture ProblemsProblem on logit models Computer Exercise Outline 1 Summary 2 Extra Topics

Summary Extra Topics Lecture Problems Problem on logit models Computer Exercise

Problem?

Yes, for ML estimation!

Then, it is possible to make the value of lnL arbitrarily close to0 (the upper bound) by choosing β arbitrarily large (in anabsolute sense)1.

Hence, no finite ML estimator exists.

1Formally: by setting β = γβ• and letting γ → ∞.L. Hoogerheide & A. Borowska Econometrics II: Tutorial No. 2 22.02.2017 15 / 75

Page 18: Econometrics II Tutorial No. 2 - GitHub Pages · 2020. 11. 10. · Summary Extra Topics Lecture ProblemsProblem on logit models Computer Exercise Outline 1 Summary 2 Extra Topics

Summary Extra Topics Lecture Problems Problem on logit models Computer Exercise

Computer arithmetic

This is exactly what any nonlinear maximization algorithm willattempt to do if there exists a vector β• for which conditions(4) and (5) are satisfied.

Because of the numerical limitations, the algorithm willeventually terminate (with some numerical error) at a value oflnL slightly less than 0.

This is likely to occur in practice when the sample is very small,when almost all of the yi are equal to 0 or almost all of themare equal to 1, or when the model fits extremely well.

L. Hoogerheide & A. Borowska Econometrics II: Tutorial No. 2 22.02.2017 16 / 75

Page 19: Econometrics II Tutorial No. 2 - GitHub Pages · 2020. 11. 10. · Summary Extra Topics Lecture ProblemsProblem on logit models Computer Exercise Outline 1 Summary 2 Extra Topics

Summary Extra Topics Lecture Problems Problem on logit models Computer Exercise

Figure 2.1: Figure 11.2 from Davidson and MacKinnon (1999),“Econometric Theory and Methods”: A perfect classifier yields a separatinghyperplane.

L. Hoogerheide & A. Borowska Econometrics II: Tutorial No. 2 22.02.2017 17 / 75

Page 20: Econometrics II Tutorial No. 2 - GitHub Pages · 2020. 11. 10. · Summary Extra Topics Lecture ProblemsProblem on logit models Computer Exercise Outline 1 Summary 2 Extra Topics

Summary Extra Topics Lecture Problems Problem on logit models Computer Exercise

Simulation from the latent variable model

Consider the latent variable model

y∗i = β0 + β1xi + ei,

ei ∼ N (0, 1),

yi =

{1, if y∗i > 0,

0, if y∗i ≤ 0

L. Hoogerheide & A. Borowska Econometrics II: Tutorial No. 2 22.02.2017 18 / 75

Page 21: Econometrics II Tutorial No. 2 - GitHub Pages · 2020. 11. 10. · Summary Extra Topics Lecture ProblemsProblem on logit models Computer Exercise Outline 1 Summary 2 Extra Topics

Summary Extra Topics Lecture Problems Problem on logit models Computer Exercise

Suppose that xi ∼ N (0, 1). We will generate 5, 000 samples of20 observations on (xi, yi) pairs in the following way:

1, 000 assuming that β0 = 0 and β1 = 1;

1, 000 assuming that β0 = 1 and β1 = 1;

1, 000 assuming that β0 = −1 and β1 = 1;

1, 000 assuming that β0 = 0 and β1 = 2;

1, 000 assuming that β0 = 0 and β1 = 3.

For each of the 5, 000 samples, we will attempt to estimate aprobit model.

L. Hoogerheide & A. Borowska Econometrics II: Tutorial No. 2 22.02.2017 19 / 75

Page 22: Econometrics II Tutorial No. 2 - GitHub Pages · 2020. 11. 10. · Summary Extra Topics Lecture ProblemsProblem on logit models Computer Exercise Outline 1 Summary 2 Extra Topics

Summary Extra Topics Lecture Problems Problem on logit models Computer Exercise

We are interested in the following question:

In each of the five cases, what proportion of the time does theestimation fail because of perfect classifiers?

We also want to explain why there will be more failures in somecases than in others.

Next, we will repeat this exercise for five sets of 1, 000 samplesof size 40, with the same parameter values.

This will allow us to draw a conclusion about the effect ofsample size on the perfect classifier problem.

L. Hoogerheide & A. Borowska Econometrics II: Tutorial No. 2 22.02.2017 20 / 75

Page 23: Econometrics II Tutorial No. 2 - GitHub Pages · 2020. 11. 10. · Summary Extra Topics Lecture ProblemsProblem on logit models Computer Exercise Outline 1 Summary 2 Extra Topics

Summary Extra Topics Lecture Problems Problem on logit models Computer Exercise

EViews code for the first case (N = 20 with β0 and β1).

L. Hoogerheide & A. Borowska Econometrics II: Tutorial No. 2 22.02.2017 21 / 75

Page 24: Econometrics II Tutorial No. 2 - GitHub Pages · 2020. 11. 10. · Summary Extra Topics Lecture ProblemsProblem on logit models Computer Exercise Outline 1 Summary 2 Extra Topics

Summary Extra Topics Lecture Problems Problem on logit models Computer Exercise

If you are interested, you can check the results of each probitestimation: the coefficients estimates, their standard errors andthe loglikelihood values are stored in matrices eq coeff,eq stderrs and eq logl, respectively.

But what we are truly after, is the error count variable,err no1, which reports how many times an estimation erroroccurred.

Notice, that we used the command setmaxerr to set themaximum number of error that the program may encounterbefore execution is halted.

L. Hoogerheide & A. Borowska Econometrics II: Tutorial No. 2 22.02.2017 22 / 75

Page 25: Econometrics II Tutorial No. 2 - GitHub Pages · 2020. 11. 10. · Summary Extra Topics Lecture ProblemsProblem on logit models Computer Exercise Outline 1 Summary 2 Extra Topics

Summary Extra Topics Lecture Problems Problem on logit models Computer Exercise

Alternatively, you can specify it in the box showing up afterclicking on the run button.

L. Hoogerheide & A. Borowska Econometrics II: Tutorial No. 2 22.02.2017 23 / 75

Page 26: Econometrics II Tutorial No. 2 - GitHub Pages · 2020. 11. 10. · Summary Extra Topics Lecture ProblemsProblem on logit models Computer Exercise Outline 1 Summary 2 Extra Topics

Summary Extra Topics Lecture Problems Problem on logit models Computer Exercise

Without changing the value of maximum error allowed, theprogram would shortly break with the error message reportingthe perfect separation problem.

L. Hoogerheide & A. Borowska Econometrics II: Tutorial No. 2 22.02.2017 24 / 75

Page 27: Econometrics II Tutorial No. 2 - GitHub Pages · 2020. 11. 10. · Summary Extra Topics Lecture ProblemsProblem on logit models Computer Exercise Outline 1 Summary 2 Extra Topics

Summary Extra Topics Lecture Problems Problem on logit models Computer Exercise

The proportion of the time that perfect classifiers wereencountered for each of the five cases and each of the twosample sizes:

Parameters n = 20 n = 40

β0 = 0, β1 = 1 0.012 0.000β0 = 1, β1 = 1 0.074 0.001β0 = −1, β1 = 1 0.056 0.002β0 = 0, β1 = 2 0.143 0.008β0 = 0, β1 = 3 0.286 0.052

L. Hoogerheide & A. Borowska Econometrics II: Tutorial No. 2 22.02.2017 25 / 75

Page 28: Econometrics II Tutorial No. 2 - GitHub Pages · 2020. 11. 10. · Summary Extra Topics Lecture ProblemsProblem on logit models Computer Exercise Outline 1 Summary 2 Extra Topics

Summary Extra Topics Lecture Problems Problem on logit models Computer Exercise

The proportion of samples with perfect classifiers increases asboth β0 and β1 increase in absolute value. When β0 = 0 , theunconditional expectation of yi is 0.5.

As β0 increases in absolute value, this expectation becomeslarger, and the proportion of 1s in the sample increases.

As β1 becomes larger in absolute value, the model fits better onaverage, which obviously increases the chance that it fitsperfectly.

The results for parameters (1, 1) are almost identical to thosefor parameters (−1, 1) because, with xi having mean 0, thefraction of 1s in the samples with parameters (1, 1) is the same,on average, as the fraction of 0s in the samples with parameters(−1, 1).

L. Hoogerheide & A. Borowska Econometrics II: Tutorial No. 2 22.02.2017 26 / 75

Page 29: Econometrics II Tutorial No. 2 - GitHub Pages · 2020. 11. 10. · Summary Extra Topics Lecture ProblemsProblem on logit models Computer Exercise Outline 1 Summary 2 Extra Topics

Summary Extra Topics Lecture Problems Problem on logit models Computer Exercise

Comparing the results for n = 20 and n = 40, it is clear thatthe probability of encountering a perfect classifier falls veryrapidly as the sample size increases.

L. Hoogerheide & A. Borowska Econometrics II: Tutorial No. 2 22.02.2017 27 / 75

Page 30: Econometrics II Tutorial No. 2 - GitHub Pages · 2020. 11. 10. · Summary Extra Topics Lecture ProblemsProblem on logit models Computer Exercise Outline 1 Summary 2 Extra Topics

Summary Extra Topics Lecture Problems Problem on logit models Computer Exercise

Lecture Problems

L. Hoogerheide & A. Borowska Econometrics II: Tutorial No. 2 22.02.2017 28 / 75

Page 31: Econometrics II Tutorial No. 2 - GitHub Pages · 2020. 11. 10. · Summary Extra Topics Lecture ProblemsProblem on logit models Computer Exercise Outline 1 Summary 2 Extra Topics

Summary Extra Topics Lecture Problems Problem on logit models Computer Exercise

Lecture Problems: Exercise 3

Show that the ordered probit model (with two explanatoryvariables xi1 and xi2) with m = 2 alternatives is the binaryprobit model with constant term β0 = −τ1, by showing thatP(yi = 1|xi) is the same in both models.

L. Hoogerheide & A. Borowska Econometrics II: Tutorial No. 2 22.02.2017 28 / 75

Page 32: Econometrics II Tutorial No. 2 - GitHub Pages · 2020. 11. 10. · Summary Extra Topics Lecture ProblemsProblem on logit models Computer Exercise Outline 1 Summary 2 Extra Topics

Summary Extra Topics Lecture Problems Problem on logit models Computer Exercise

Ordered probit model in case of 2 categories yi ∈ {0, 1} andtwo explanatory variables xi1 and xi2.

Latent variable y∗i :

y∗i = β1xi1 + β2xi2 + ei,

where ei ∼ N(0, 1), i.i.d. We have observed variable yi:

yi =

{0 if −∞ < y∗i ≤ τ1,1 if τ1 < y∗i ≤ ∞,

with threshold value τ1.

L. Hoogerheide & A. Borowska Econometrics II: Tutorial No. 2 22.02.2017 29 / 75

Page 33: Econometrics II Tutorial No. 2 - GitHub Pages · 2020. 11. 10. · Summary Extra Topics Lecture ProblemsProblem on logit models Computer Exercise Outline 1 Summary 2 Extra Topics

Summary Extra Topics Lecture Problems Problem on logit models Computer Exercise

We have:

P(yi = 1|xi) = P(y∗i > τ1|xi)= P(β1xi1 + β2xi2 + ei > τ1|xi)= P(ei > τ1 − β1xi1 − β2xi2|xi)(∗)= P(ei < −τ1 + β1xi1 + β2xi2|xi)(∗∗)= P(ei ≤ −τ1 + β1xi1 + β2xi2|xi)(∗∗∗)= P(ei ≤ −τ1 + β1xi1 + β2xi2)

= Φ(−τ1 + β1xi1 + β2xi2),

the standard normal distribution of ei is (∗) symmetric around0, (∗∗) continuous and (∗ ∗ ∗) independent of xi; Φ(.) is theCDF of the standard normal distribution.

L. Hoogerheide & A. Borowska Econometrics II: Tutorial No. 2 22.02.2017 30 / 75

Page 34: Econometrics II Tutorial No. 2 - GitHub Pages · 2020. 11. 10. · Summary Extra Topics Lecture ProblemsProblem on logit models Computer Exercise Outline 1 Summary 2 Extra Topics

Summary Extra Topics Lecture Problems Problem on logit models Computer Exercise

Further, since yi = 0 or yi = 1 we have

P(yi = 0|xi) + P(yi = 1|xi) = 1,

so that

P(yi = 0|xi) = 1− P(yi = 1|xi) = 1− Φ(−τ1 + β1xi1 + β2xi2).

L. Hoogerheide & A. Borowska Econometrics II: Tutorial No. 2 22.02.2017 31 / 75

Page 35: Econometrics II Tutorial No. 2 - GitHub Pages · 2020. 11. 10. · Summary Extra Topics Lecture ProblemsProblem on logit models Computer Exercise Outline 1 Summary 2 Extra Topics

Summary Extra Topics Lecture Problems Problem on logit models Computer Exercise

In the binary probit model we have

P(yi = 1|xi) = Φ(β0 + β1xi1 + β2xi2),

P(yi = 0|xi) = 1− P(yi = 1|xi) = 1− Φ(β0 + β1xi1 + β2xi2).

So, indeed P(yi = 1|xi) is the same in the binary probit modeland in the ordered probit model with m = 2 alternatives (with−τ1 = β0).

L. Hoogerheide & A. Borowska Econometrics II: Tutorial No. 2 22.02.2017 32 / 75

Page 36: Econometrics II Tutorial No. 2 - GitHub Pages · 2020. 11. 10. · Summary Extra Topics Lecture ProblemsProblem on logit models Computer Exercise Outline 1 Summary 2 Extra Topics

Summary Extra Topics Lecture Problems Problem on logit models Computer Exercise

Therefore: the ordered probit model reduces to the binaryprobit model if we have only m = 2 alternatives.I.e.: they have the same Bernoulli distribution for yi(conditionally upon xi).

In a similar way it holds that the ordered logit model reduces tothe binary logit model if we have only m = 2 alternatives.

L. Hoogerheide & A. Borowska Econometrics II: Tutorial No. 2 22.02.2017 33 / 75

Page 37: Econometrics II Tutorial No. 2 - GitHub Pages · 2020. 11. 10. · Summary Extra Topics Lecture ProblemsProblem on logit models Computer Exercise Outline 1 Summary 2 Extra Topics

Summary Extra Topics Lecture Problems Problem on logit models Computer Exercise

Lecture Problems: Exercise 4

The EViews file bank employees exercise13.wf1 contains thedata, where also two variables have been added:

admin0 manage1 cust2 (where 0 = administrative, 1 =management, 2 = custodial), where the ordering is donebased on average value of malei per category;

admin0 cust1 manage2 (where 0 = administrative, 1 =custodial, 2 = management), where the ordering is donebased on average value of salary per category.

Estimate two ordered logit models using these series asdependent variable (and education and male as explanatoryvariables). Compare the AIC, SC and prediction quality withthe model where the categories are ordered with education (withdependent variable ORDERED JOB CATEGORY, which is used on theslides). Can you explain the differences?

L. Hoogerheide & A. Borowska Econometrics II: Tutorial No. 2 22.02.2017 34 / 75

Page 38: Econometrics II Tutorial No. 2 - GitHub Pages · 2020. 11. 10. · Summary Extra Topics Lecture ProblemsProblem on logit models Computer Exercise Outline 1 Summary 2 Extra Topics

Summary Extra Topics Lecture Problems Problem on logit models Computer Exercise

We have:

dependent variable AIC SC percentagecorrectlypredicted

ORDERED JOB CATEGORY 0.829509 0.864624 85.232%admin0 manage1 cust2 1.151120 1.186236 77.215%admin0 cust1 manage2 1.051928 1.087044 84.810%

L. Hoogerheide & A. Borowska Econometrics II: Tutorial No. 2 22.02.2017 35 / 75

Page 39: Econometrics II Tutorial No. 2 - GitHub Pages · 2020. 11. 10. · Summary Extra Topics Lecture ProblemsProblem on logit models Computer Exercise Outline 1 Summary 2 Extra Topics

Summary Extra Topics Lecture Problems Problem on logit models Computer Exercise

Note:

ORDERED JOB CATEGORY could be called‘cust0 admin1 manage2’ (where 0 = custodial, 1 =administrative, 2 = management).

The model with (0 = custodial, 1 = administrative, 2 =management) is the best: the lowest (best) AIC and SC,and the highest (best) percentage correctly predicted.

Reason: education is the most important explanatory variable(more important than male), so it is best to order thecategories with education. A higher education increases theprobability of going from category 0=custodial to1=administrative, and it increases the probability of goingfrom category 1=administrative to 2=management.

L. Hoogerheide & A. Borowska Econometrics II: Tutorial No. 2 22.02.2017 36 / 75

Page 40: Econometrics II Tutorial No. 2 - GitHub Pages · 2020. 11. 10. · Summary Extra Topics Lecture ProblemsProblem on logit models Computer Exercise Outline 1 Summary 2 Extra Topics

Summary Extra Topics Lecture Problems Problem on logit models Computer Exercise

dependent variable AIC SC percentagecorrectlypredicted

ORDERED JOB CATEGORY 0.829509 0.864624 85.232%admin0 manage1 cust2 1.151120 1.186236 77.215%admin0 cust1 manage2 1.051928 1.087044 84.810%

L. Hoogerheide & A. Borowska Econometrics II: Tutorial No. 2 22.02.2017 37 / 75

Page 41: Econometrics II Tutorial No. 2 - GitHub Pages · 2020. 11. 10. · Summary Extra Topics Lecture ProblemsProblem on logit models Computer Exercise Outline 1 Summary 2 Extra Topics

Summary Extra Topics Lecture Problems Problem on logit models Computer Exercise

Note:

ORDERED JOB CATEGORY could be called‘cust0 admin1 manage2’ (where 0 = custodial, 1 =administrative, 2 = management).

The model with (where 0 = administrative, 1 =management, 2 = custodial) is the worst: the highest(worst) AIC and SC, and the lowest (worst) percentagecorrectly predicted.

Reason: male is a relatively unimportant explanatory variable(less important than education), so it is not good to order thecategories with male. Here the estimated coefficient ofeducation is ‘damaged’, because education increases theprobability of going from category 0=administrative to1=management, but it decreases the probability of going fromcategory 1=management to 2=custodial.

L. Hoogerheide & A. Borowska Econometrics II: Tutorial No. 2 22.02.2017 38 / 75

Page 42: Econometrics II Tutorial No. 2 - GitHub Pages · 2020. 11. 10. · Summary Extra Topics Lecture ProblemsProblem on logit models Computer Exercise Outline 1 Summary 2 Extra Topics

Summary Extra Topics Lecture Problems Problem on logit models Computer Exercise

dependent variable AIC SC percentagecorrectlypredicted

ORDERED JOB CATEGORY 0.829509 0.864624 85.232%admin0 manage1 cust2 1.151120 1.186236 77.215%admin0 cust1 manage2 1.051928 1.087044 84.810%

L. Hoogerheide & A. Borowska Econometrics II: Tutorial No. 2 22.02.2017 39 / 75

Page 43: Econometrics II Tutorial No. 2 - GitHub Pages · 2020. 11. 10. · Summary Extra Topics Lecture ProblemsProblem on logit models Computer Exercise Outline 1 Summary 2 Extra Topics

Summary Extra Topics Lecture Problems Problem on logit models Computer Exercise

Note:

ORDERED JOB CATEGORY could be called‘cust0 admin1 manage2’ (where 0 = custodial, 1 =administrative, 2 = management).

The model with (0 = administrative, 1 = custodial, 2 =management) is also bad: the AIC, SC and percentagecorrectly predicted are bad (close to the worst model andmuch worse than the best model).

Reason: Here the estimated coefficient of education is again‘damaged’, because education decreases the probability ofgoing from category 0=administrative to 1=custodial, but itincreases the probability of going from category1=management to 2=custodial.

L. Hoogerheide & A. Borowska Econometrics II: Tutorial No. 2 22.02.2017 40 / 75

Page 44: Econometrics II Tutorial No. 2 - GitHub Pages · 2020. 11. 10. · Summary Extra Topics Lecture ProblemsProblem on logit models Computer Exercise Outline 1 Summary 2 Extra Topics

Summary Extra Topics Lecture Problems Problem on logit models Computer Exercise

dependent variable AIC SC percentagecorrectlypredicted

ORDERED JOB CATEGORY 0.829509 0.864624 85.232%admin0 manage1 cust2 1.151120 1.186236 77.215%admin0 cust1 manage2 1.051928 1.087044 84.810%

L. Hoogerheide & A. Borowska Econometrics II: Tutorial No. 2 22.02.2017 41 / 75

Page 45: Econometrics II Tutorial No. 2 - GitHub Pages · 2020. 11. 10. · Summary Extra Topics Lecture ProblemsProblem on logit models Computer Exercise Outline 1 Summary 2 Extra Topics

Summary Extra Topics Lecture Problems Problem on logit models Computer Exercise

Note:

ORDERED JOB CATEGORY could be called‘cust0 admin1 manage2’ (where 0 = custodial, 1 =administrative, 2 = management).

Beforehand we could not say whether the model with (0 =administrative, 1 = management, 2 = custodial) or themodel with (0 = administrative, 1 = custodial, 2 =management) would be the worst.

Both of these models have a poor ordering of the categories(when looking at the effect of education on the probabilities ofbeing in the categories).

L. Hoogerheide & A. Borowska Econometrics II: Tutorial No. 2 22.02.2017 42 / 75

Page 46: Econometrics II Tutorial No. 2 - GitHub Pages · 2020. 11. 10. · Summary Extra Topics Lecture ProblemsProblem on logit models Computer Exercise Outline 1 Summary 2 Extra Topics

Summary Extra Topics Lecture Problems Problem on logit models Computer Exercise

Problem on binary, ordered & multinomiallogit models

L. Hoogerheide & A. Borowska Econometrics II: Tutorial No. 2 22.02.2017 43 / 75

Page 47: Econometrics II Tutorial No. 2 - GitHub Pages · 2020. 11. 10. · Summary Extra Topics Lecture ProblemsProblem on logit models Computer Exercise Outline 1 Summary 2 Extra Topics

Summary Extra Topics Lecture Problems Problem on logit models Computer Exercise

Problem on binary, ordered & multinomial logit models

Consider the binary logit model where

y∗i = β0 + β1xi1 + β2xi2 + ei, yi =

{1 if y∗i > 0,

0 if y∗i ≤ 0,

where the ei (i = 1, 2, . . . , n) are i.i.d. errors that have the(standard) logistic distribution with cumulative distributionfunction (CDF) given by

G(a) = P(ei ≤ a) =1

1 + exp(−a)=

exp(a)

1 + exp(a),

and where the ei (i = 1, 2, . . . , n) are independent of xj1 and xj2(j = 1, 2, . . . , n).

L. Hoogerheide & A. Borowska Econometrics II: Tutorial No. 2 22.02.2017 43 / 75

Page 48: Econometrics II Tutorial No. 2 - GitHub Pages · 2020. 11. 10. · Summary Extra Topics Lecture ProblemsProblem on logit models Computer Exercise Outline 1 Summary 2 Extra Topics

Summary Extra Topics Lecture Problems Problem on logit models Computer Exercise

Problem (a)

Derive the probability P(yi = 1|xi1, xi2) and the probabilityP(yi = 0|xi1, xi2).

L. Hoogerheide & A. Borowska Econometrics II: Tutorial No. 2 22.02.2017 44 / 75

Page 49: Econometrics II Tutorial No. 2 - GitHub Pages · 2020. 11. 10. · Summary Extra Topics Lecture ProblemsProblem on logit models Computer Exercise Outline 1 Summary 2 Extra Topics

Summary Extra Topics Lecture Problems Problem on logit models Computer Exercise

We have:

P(yi = 1|xi) = P(y∗i > 0|xi)= P(x′iβ + ei > 0|xi)= P(ei > −x′iβ|xi)(∗)= P(ei < x′iβ|xi)(∗∗)= P(ei ≤ x′iβ|xi)(∗∗∗)= P(ei ≤ x′iβ)

= G(x′iβ) =1

1 + exp(−x′iβ)

=exp(x′iβ)

1 + exp(x′iβ),

the standard logistic distribution of ei is (∗) symmetric around0, (∗∗) continuous and (∗ ∗ ∗) independent of xi.

L. Hoogerheide & A. Borowska Econometrics II: Tutorial No. 2 22.02.2017 45 / 75

Page 50: Econometrics II Tutorial No. 2 - GitHub Pages · 2020. 11. 10. · Summary Extra Topics Lecture ProblemsProblem on logit models Computer Exercise Outline 1 Summary 2 Extra Topics

Summary Extra Topics Lecture Problems Problem on logit models Computer Exercise

Further, yi is either 0 or 1, so that

P(yi = 0|xi1, xi2) + P(yi = 1|xi1, xi2) = 1,

so we have:

P(yi = 0|xi1, xi2) = 1−G(x′iβ) =1

1 + exp(x′iβ).

L. Hoogerheide & A. Borowska Econometrics II: Tutorial No. 2 22.02.2017 46 / 75

Page 51: Econometrics II Tutorial No. 2 - GitHub Pages · 2020. 11. 10. · Summary Extra Topics Lecture ProblemsProblem on logit models Computer Exercise Outline 1 Summary 2 Extra Topics

Summary Extra Topics Lecture Problems Problem on logit models Computer Exercise

Problem (b)

Derive the loglikelihood in this model.

L. Hoogerheide & A. Borowska Econometrics II: Tutorial No. 2 22.02.2017 47 / 75

Page 52: Econometrics II Tutorial No. 2 - GitHub Pages · 2020. 11. 10. · Summary Extra Topics Lecture ProblemsProblem on logit models Computer Exercise Outline 1 Summary 2 Extra Topics

Summary Extra Topics Lecture Problems Problem on logit models Computer Exercise

The likelihood per observation i is the probability function ofyi, conditionally upon xi:

p(yi|xi) = [G(x′iβ)]yi [1−G(x′iβ)]1−yi =

{G(x′iβ) if yi = 1,

1−G(x′iβ) if yi = 0.

L. Hoogerheide & A. Borowska Econometrics II: Tutorial No. 2 22.02.2017 48 / 75

Page 53: Econometrics II Tutorial No. 2 - GitHub Pages · 2020. 11. 10. · Summary Extra Topics Lecture ProblemsProblem on logit models Computer Exercise Outline 1 Summary 2 Extra Topics

Summary Extra Topics Lecture Problems Problem on logit models Computer Exercise

The likelihood is the joint probability function of the yi(i = 1, 2, . . . , n), conditionally upon the xi (i = 1, 2, . . . , n):

L(β) = p(y1, . . . , yn|x1, . . . , xn)

(∗)=

n∏i=1

p(yi|xi)

=

n∏i=1

[G(x′iβ)]yi [1−G(x′iβ)]1−yi ,

where in (∗) we used the assumption that the yi areindependent (conditionally upon the xi). In other words, weassume that the ei are independent.

L. Hoogerheide & A. Borowska Econometrics II: Tutorial No. 2 22.02.2017 49 / 75

Page 54: Econometrics II Tutorial No. 2 - GitHub Pages · 2020. 11. 10. · Summary Extra Topics Lecture ProblemsProblem on logit models Computer Exercise Outline 1 Summary 2 Extra Topics

Summary Extra Topics Lecture Problems Problem on logit models Computer Exercise

The loglikelihood is simply the (natural) logarithm of thelikelihood:

lnL(β) = ln p(y1, . . . , yn|x1, . . . , xn)

=

n∑i=1

{yi ln[G(x′iβ)] + (1− yi) ln[1−G(x′iβ)]

}.

L. Hoogerheide & A. Borowska Econometrics II: Tutorial No. 2 22.02.2017 50 / 75

Page 55: Econometrics II Tutorial No. 2 - GitHub Pages · 2020. 11. 10. · Summary Extra Topics Lecture ProblemsProblem on logit models Computer Exercise Outline 1 Summary 2 Extra Topics

Summary Extra Topics Lecture Problems Problem on logit models Computer Exercise

Problem (c)

Suppose that we analyse data on a presidential election, wherethere are two candidates, say C and T. We observe n = 1000observations. We have:

yi =

{1 if person i votes for candidate C,

0 if person i votes for candidate T,

x2i = number of years of education of person i, x2i ∈ [12, 20],

and

x3i =

{1 if person i is a female,

0 if person i is a male.

Figure 4.1 contains ML estimation output and graphs of theestimated probability P̂(yi = 1|xi1, xi2).Explain why the estimates of β1 and β2 match with the graphsof the estimated probability P̂(yi = 1|xi1, xi2).

L. Hoogerheide & A. Borowska Econometrics II: Tutorial No. 2 22.02.2017 51 / 75

Page 56: Econometrics II Tutorial No. 2 - GitHub Pages · 2020. 11. 10. · Summary Extra Topics Lecture ProblemsProblem on logit models Computer Exercise Outline 1 Summary 2 Extra Topics

Summary Extra Topics Lecture Problems Problem on logit models Computer Exercise

Figure 4.1: Binary logit model: estimation output and graphs of theestimated probability P̂(yi = 1|xi1, xi2).

L. Hoogerheide & A. Borowska Econometrics II: Tutorial No. 2 22.02.2017 52 / 75

Page 57: Econometrics II Tutorial No. 2 - GitHub Pages · 2020. 11. 10. · Summary Extra Topics Lecture ProblemsProblem on logit models Computer Exercise Outline 1 Summary 2 Extra Topics

Summary Extra Topics Lecture Problems Problem on logit models Computer Exercise

The estimated coefficients β̂1 (at education xi1) and β̂2 (atfemale xi2) are significantly positive, which matches with thefact that P̂(yi = 1|xi1, xi2) is increasing with education and ishigher for females than for males.

The graph for males is the graph for females shifted0.91/0.17=5.35 to the right.

L. Hoogerheide & A. Borowska Econometrics II: Tutorial No. 2 22.02.2017 53 / 75

Page 58: Econometrics II Tutorial No. 2 - GitHub Pages · 2020. 11. 10. · Summary Extra Topics Lecture ProblemsProblem on logit models Computer Exercise Outline 1 Summary 2 Extra Topics

Summary Extra Topics Lecture Problems Problem on logit models Computer Exercise

Problem (d)

Now suppose there are three candidates, say C, T and B. Wehave:

yi =

0 if person i votes for candidate C,

1 if person i votes for candidate T,

2 if person i votes for candidate B.

Figures 4.2 and 4.3 contain ML estimation output and graphs ofthe estimated probabilities P̂(yi = 0|xi1, xi2), P̂(yi = 1|xi1, xi2)and P̂(yi = 2|xi1, xi2) in the multinomial logit model (withreference category 0). Explain why the estimates of thecoefficients match with the graphs of the estimated probabilitiesP̂(yi = 0|xi1, xi2), P̂(yi = 1|xi1, xi2) and P̂(yi = 2|xi1, xi2).

L. Hoogerheide & A. Borowska Econometrics II: Tutorial No. 2 22.02.2017 54 / 75

Page 59: Econometrics II Tutorial No. 2 - GitHub Pages · 2020. 11. 10. · Summary Extra Topics Lecture ProblemsProblem on logit models Computer Exercise Outline 1 Summary 2 Extra Topics

Summary Extra Topics Lecture Problems Problem on logit models Computer Exercise

Figure 4.2: Multinomial logit model: estimation output.

L. Hoogerheide & A. Borowska Econometrics II: Tutorial No. 2 22.02.2017 55 / 75

Page 60: Econometrics II Tutorial No. 2 - GitHub Pages · 2020. 11. 10. · Summary Extra Topics Lecture ProblemsProblem on logit models Computer Exercise Outline 1 Summary 2 Extra Topics

Summary Extra Topics Lecture Problems Problem on logit models Computer Exercise

Figure 4.3: Multinomial logit model: graphs of the estimated probabilitiesP̂(yi = 0|xi1, xi2), P̂(yi = 1|xi1, xi2) and P̂(yi = 2|xi1, xi2).

L. Hoogerheide & A. Borowska Econometrics II: Tutorial No. 2 22.02.2017 56 / 75

Page 61: Econometrics II Tutorial No. 2 - GitHub Pages · 2020. 11. 10. · Summary Extra Topics Lecture ProblemsProblem on logit models Computer Exercise Outline 1 Summary 2 Extra Topics

Summary Extra Topics Lecture Problems Problem on logit models Computer Exercise

In this multinomial logit model we have probabilities:

P(yi = 0|xi)

=1

1 + exp(β(1)0 + β

(1)1 xi1 + β

(1)2 xi2) + exp(β

(2)0 + β

(2)1 xi1 + β

(2)2 xi2)

,

P(yi = 1|xi)

=exp(β

(1)0 + β

(1)1 xi1 + β

(1)2 xi2)

1 + exp(β(1)0 + β

(1)1 xi1 + β

(1)2 xi2) + exp(β

(2)0 + β

(2)1 xi1 + β

(2)2 xi2)

,

P(yi = 2|xi)

=exp(β

(2)0 + β

(2)1 xi1 + β

(2)2 xi2)

1 + exp(β(1)0 + β

(1)1 xi1 + β

(1)2 xi2) + exp(β

(2)0 + β

(2)1 xi1 + β

(2)2 xi2)

.

L. Hoogerheide & A. Borowska Econometrics II: Tutorial No. 2 22.02.2017 57 / 75

Page 62: Econometrics II Tutorial No. 2 - GitHub Pages · 2020. 11. 10. · Summary Extra Topics Lecture ProblemsProblem on logit models Computer Exercise Outline 1 Summary 2 Extra Topics

Summary Extra Topics Lecture Problems Problem on logit models Computer Exercise

Note: we have odds ratio

P(yi = 1|xi)P(yi = 0|xi)

= exp(β(1)0 + β

(1)1 xi1 + β

(1)2 xi2),

so that

ln

(P(yi = 1|xi)P(yi = 0|xi)

)= β

(1)0 + β

(1)1 xi1 + β

(1)2 xi2.

L. Hoogerheide & A. Borowska Econometrics II: Tutorial No. 2 22.02.2017 58 / 75

Page 63: Econometrics II Tutorial No. 2 - GitHub Pages · 2020. 11. 10. · Summary Extra Topics Lecture ProblemsProblem on logit models Computer Exercise Outline 1 Summary 2 Extra Topics

Summary Extra Topics Lecture Problems Problem on logit models Computer Exercise

Looking at the effect of education:

Reference category 0 (voting C) has coefficient 0 (bydefinition).

Category 1 (voting T) has significantly negative estimatedcoefficient C(2) = -0.12: an increase in educationdecreases

P̂(yi = 1|xi1, xi2)P̂(yi = 0|xi1, xi2)

.

Category 2 (voting B) has significantly positive estimatedcoefficient C(5) = 0.82: an increase in education increases

P̂(yi = 2|xi1, xi2)P̂(yi = 0|xi1, xi2)

.

L. Hoogerheide & A. Borowska Econometrics II: Tutorial No. 2 22.02.2017 59 / 75

Page 64: Econometrics II Tutorial No. 2 - GitHub Pages · 2020. 11. 10. · Summary Extra Topics Lecture ProblemsProblem on logit models Computer Exercise Outline 1 Summary 2 Extra Topics

Summary Extra Topics Lecture Problems Problem on logit models Computer Exercise

Hence, an increase in education increases P̂(yi = 2|xi1, xi2) (B)and decreases P̂(yi = 1|xi1, xi2) (T).

L. Hoogerheide & A. Borowska Econometrics II: Tutorial No. 2 22.02.2017 60 / 75

Page 65: Econometrics II Tutorial No. 2 - GitHub Pages · 2020. 11. 10. · Summary Extra Topics Lecture ProblemsProblem on logit models Computer Exercise Outline 1 Summary 2 Extra Topics

Summary Extra Topics Lecture Problems Problem on logit models Computer Exercise

Looking at the effect of female (xi2 = 1 for female, xi2 = 0 formale):

Reference category 0 (voting C) has coefficient 0 (bydefinition).

Category 1 (voting T) has significantly negative estimatedcoefficient C(3) = -0.86:

P̂(yi = 1|xi1, xi2 = 1)

P̂(yi = 0|xi1, xi2 = 0)< 1.

Category 2 (voting B) has insignificant estimatedcoefficient C(6) = 0.19: we can not reject that

P̂(yi = 2|xi1, xi2 = 1)

P̂(yi = 0|xi1, xi2 = 0)= 1.

Hence,

P̂(yi = 1|xi1, xi2) (T) is lower for females than for males.

P̂(yi = 0|xi1, xi2) (C) and P̂(yi = 2|xi1, xi2) (B) are higherfor females than for males.

L. Hoogerheide & A. Borowska Econometrics II: Tutorial No. 2 22.02.2017 61 / 75

Page 66: Econometrics II Tutorial No. 2 - GitHub Pages · 2020. 11. 10. · Summary Extra Topics Lecture ProblemsProblem on logit models Computer Exercise Outline 1 Summary 2 Extra Topics

Summary Extra Topics Lecture Problems Problem on logit models Computer Exercise

Problem (e)

Could an ordered logit model be appropriate in this case?Motivate your answer.

L. Hoogerheide & A. Borowska Econometrics II: Tutorial No. 2 22.02.2017 62 / 75

Page 67: Econometrics II Tutorial No. 2 - GitHub Pages · 2020. 11. 10. · Summary Extra Topics Lecture ProblemsProblem on logit models Computer Exercise Outline 1 Summary 2 Extra Topics

Summary Extra Topics Lecture Problems Problem on logit models Computer Exercise

No: the alternatives can not be ordered in such a way that theexplanatory variables ‘push’ someone from the first to thesecond alternative and from the second to the third alternative.

education ‘pushes’ from T to C and from C to B;

female ‘pushes’ from T to C but not (significantly)from C to B.

L. Hoogerheide & A. Borowska Econometrics II: Tutorial No. 2 22.02.2017 63 / 75

Page 68: Econometrics II Tutorial No. 2 - GitHub Pages · 2020. 11. 10. · Summary Extra Topics Lecture ProblemsProblem on logit models Computer Exercise Outline 1 Summary 2 Extra Topics

Summary Extra Topics Lecture Problems Problem on logit models Computer Exercise

However, if we ignore the fact that the positive estimated effectof female on

P̂(yi = 2|xi1, xi2 = 1)

P̂(yi = 0|xi1, xi2 = 0)

is not significant, then yes: we can order the alternatives T, C,B, where both the variables education and female ‘push’persons from T to C and from C to B. In that case the orderedlogit model could be appropriate.

L. Hoogerheide & A. Borowska Econometrics II: Tutorial No. 2 22.02.2017 64 / 75

Page 69: Econometrics II Tutorial No. 2 - GitHub Pages · 2020. 11. 10. · Summary Extra Topics Lecture ProblemsProblem on logit models Computer Exercise Outline 1 Summary 2 Extra Topics

Summary Extra Topics Lecture Problems Problem on logit models Computer Exercise

Computer Exercise

L. Hoogerheide & A. Borowska Econometrics II: Tutorial No. 2 22.02.2017 65 / 75

Page 70: Econometrics II Tutorial No. 2 - GitHub Pages · 2020. 11. 10. · Summary Extra Topics Lecture ProblemsProblem on logit models Computer Exercise Outline 1 Summary 2 Extra Topics

Summary Extra Topics Lecture Problems Problem on logit models Computer Exercise

W17/C2 (i)

Use the data in loanapp.wf1 for this exercise.

(i) Estimate a probit model of approve on white. Find theestimated probability of loan approval for both whites andnonwhites. How do these compare with the linear probabilityestimates?

L. Hoogerheide & A. Borowska Econometrics II: Tutorial No. 2 22.02.2017 65 / 75

Page 71: Econometrics II Tutorial No. 2 - GitHub Pages · 2020. 11. 10. · Summary Extra Topics Lecture ProblemsProblem on logit models Computer Exercise Outline 1 Summary 2 Extra Topics

Summary Extra Topics Lecture Problems Problem on logit models Computer Exercise

L. Hoogerheide & A. Borowska Econometrics II: Tutorial No. 2 22.02.2017 66 / 75

Page 72: Econometrics II Tutorial No. 2 - GitHub Pages · 2020. 11. 10. · Summary Extra Topics Lecture ProblemsProblem on logit models Computer Exercise Outline 1 Summary 2 Extra Topics

Summary Extra Topics Lecture Problems Problem on logit models Computer Exercise

As there is only one explanatory variable that takes on just twovalues, there are only two different predicted values: theestimated probabilities of loan approval for white and nonwhiteapplicants. Rounded to three decimal places these are:

P(approve = 1|white = 0) = Φ(β0 + β1 · 0)

= Φ(0.547) = 0.708,

P(approve = 1|white = 1) = Φ(β0 + β1 · 1)

= Φ(0.547 + 0.784) = 0.908,

for nonwhites and whites, respectively.

(In other words, 0.708 is the proportion of loans approved fornonwhites and 0.908 is the proportion approved for whites.)

L. Hoogerheide & A. Borowska Econometrics II: Tutorial No. 2 22.02.2017 67 / 75

Page 73: Econometrics II Tutorial No. 2 - GitHub Pages · 2020. 11. 10. · Summary Extra Topics Lecture ProblemsProblem on logit models Computer Exercise Outline 1 Summary 2 Extra Topics

Summary Extra Topics Lecture Problems Problem on logit models Computer Exercise

W17/C2 (ii)

(ii) Now, add the variables hrat, obrat, loanprc, unem, male,married, dep, sch, cosign, chist, pubrec, mortlat1, mortlat2,and vr to the probit model. Is there statistically significantevidence of discrimination against nonwhites?

L. Hoogerheide & A. Borowska Econometrics II: Tutorial No. 2 22.02.2017 68 / 75

Page 74: Econometrics II Tutorial No. 2 - GitHub Pages · 2020. 11. 10. · Summary Extra Topics Lecture ProblemsProblem on logit models Computer Exercise Outline 1 Summary 2 Extra Topics

Summary Extra Topics Lecture Problems Problem on logit models Computer Exercise

With the set of controls added, the probit estimate on whitebecomes about 0.520 with the standard error of around 0.097.Therefore, there is still very strong evidence of discriminationagainst nonwhites.

L. Hoogerheide & A. Borowska Econometrics II: Tutorial No. 2 22.02.2017 69 / 75

Page 75: Econometrics II Tutorial No. 2 - GitHub Pages · 2020. 11. 10. · Summary Extra Topics Lecture ProblemsProblem on logit models Computer Exercise Outline 1 Summary 2 Extra Topics

Summary Extra Topics Lecture Problems Problem on logit models Computer Exercise

W17/C2 (iii)

(iii) Estimate the model from part (ii) by logit. Compare thecoefficient on white to the probit estimate.

L. Hoogerheide & A. Borowska Econometrics II: Tutorial No. 2 22.02.2017 70 / 75

Page 76: Econometrics II Tutorial No. 2 - GitHub Pages · 2020. 11. 10. · Summary Extra Topics Lecture ProblemsProblem on logit models Computer Exercise Outline 1 Summary 2 Extra Topics

Summary Extra Topics Lecture Problems Problem on logit models Computer Exercise

When we use logit instead of probit, the coefficient on whitebecomes 0.938 with the standard error of 0.173.

L. Hoogerheide & A. Borowska Econometrics II: Tutorial No. 2 22.02.2017 71 / 75

Page 77: Econometrics II Tutorial No. 2 - GitHub Pages · 2020. 11. 10. · Summary Extra Topics Lecture ProblemsProblem on logit models Computer Exercise Outline 1 Summary 2 Extra Topics

Summary Extra Topics Lecture Problems Problem on logit models Computer Exercise

W17/C1 (iv)

(iv) Use equation

n−1n∑

i=1

{G[β̂0 + β̂1xi1 + · · ·+ β̂k−1xik−1 + β̂k(ck + 1)

]−G[β̂0 + β̂1xi1 + · · ·+ β̂k−1xik−1 + β̂kck

]}(17.17)

to estimate the sizes of the discrimination effects for probit andlogit.

L. Hoogerheide & A. Borowska Econometrics II: Tutorial No. 2 22.02.2017 72 / 75

Page 78: Econometrics II Tutorial No. 2 - GitHub Pages · 2020. 11. 10. · Summary Extra Topics Lecture ProblemsProblem on logit models Computer Exercise Outline 1 Summary 2 Extra Topics

Summary Extra Topics Lecture Problems Problem on logit models Computer Exercise

Note that (17.17) is the average partial effect for a discreteexplanatory variable.

We consider all the variables but white. Instead, for eachindividual we consider two counterfactual scenarios: as if he orshe was white and otherwise (new generated variables white1

and white0), which we use to create two groups

(variables white1 and variables white0).

Then, we use the coefficients from two estimations(coef probit and coef logit) to sum all the variablesmultiplied by their respective coefficient.

L. Hoogerheide & A. Borowska Econometrics II: Tutorial No. 2 22.02.2017 73 / 75

Page 79: Econometrics II Tutorial No. 2 - GitHub Pages · 2020. 11. 10. · Summary Extra Topics Lecture ProblemsProblem on logit models Computer Exercise Outline 1 Summary 2 Extra Topics

Summary Extra Topics Lecture Problems Problem on logit models Computer Exercise

This gives us the arguments inside G(·) in (17.17).

To evaluate G(·) we need to apply the appropriate function foreach model.

For probit, it is Φ(z), the cdf of the standard normaldistribution;for logit, it is 1

1+exp(−z) .

Finally, we subtract the vector with G(·) applied to the sumunder the “nonwhites scenario” from that under the “whitesscenario” and average out.

The obtained values are APEprobit = 0.1042 andAPElogit = 0.1009, hence quite similar.

L. Hoogerheide & A. Borowska Econometrics II: Tutorial No. 2 22.02.2017 74 / 75

Page 80: Econometrics II Tutorial No. 2 - GitHub Pages · 2020. 11. 10. · Summary Extra Topics Lecture ProblemsProblem on logit models Computer Exercise Outline 1 Summary 2 Extra Topics

Summary Extra Topics Lecture Problems Problem on logit models Computer Exercise

L. Hoogerheide & A. Borowska Econometrics II: Tutorial No. 2 22.02.2017 75 / 75