+ All Categories
Home > Documents > THE DUMMY VARIABLE TRAP 1 Suppose that you have a regression model with Y depending on a set of...

THE DUMMY VARIABLE TRAP 1 Suppose that you have a regression model with Y depending on a set of...

Date post: 24-Dec-2015
Category:
Upload: alexandrina-carson
View: 247 times
Download: 2 times
Share this document with a friend
Popular Tags:
14
THE DUMMY VARIABLE TRAP 1 Suppose that you have a regression model with Y depending on a set of ordinary variables X 2 , ..., X k and a qualitative variable. u D D X X Y s s k k ... ... 2 2 2 2 1
Transcript
Page 1: THE DUMMY VARIABLE TRAP 1 Suppose that you have a regression model with Y depending on a set of ordinary variables X 2,..., X k and a qualitative variable.

THE DUMMY VARIABLE TRAP

1

Suppose that you have a regression model with Y depending on a set of ordinary variables X2, ..., Xk and a qualitative variable.

uDDXXY sskk ...... 22221

Page 2: THE DUMMY VARIABLE TRAP 1 Suppose that you have a regression model with Y depending on a set of ordinary variables X 2,..., X k and a qualitative variable.

2

Suppose that the qualitative variable has s categories. We choose one of them as the omitted category (without loss of generality, category 1) and define dummy variables D2, ..., Ds for the rest.

THE DUMMY VARIABLE TRAP

uDDXXY sskk ...... 22221

Page 3: THE DUMMY VARIABLE TRAP 1 Suppose that you have a regression model with Y depending on a set of ordinary variables X 2,..., X k and a qualitative variable.

3

What would happen if we did not drop the reference category? Suppose we defined a dummy variable D1 for it and included it in the specification. What would happen then?

THE DUMMY VARIABLE TRAP

uDDXXY sskk ...... 22221

uDDDXXY sskk ...... 2211221

Page 4: THE DUMMY VARIABLE TRAP 1 Suppose that you have a regression model with Y depending on a set of ordinary variables X 2,..., X k and a qualitative variable.

4

We would fall into the dummy variable trap. It would be impossible to fit the model as specified.

THE DUMMY VARIABLE TRAP

uDDXXY sskk ...... 22221

uDDDXXY sskk ...... 2211221

Page 5: THE DUMMY VARIABLE TRAP 1 Suppose that you have a regression model with Y depending on a set of ordinary variables X 2,..., X k and a qualitative variable.

5

We will start with an intuitive explanation. The coefficient of each dummy variable represents the increase in the intercept relative to that for the basic category. But there is no basic category for such a comparison.

THE DUMMY VARIABLE TRAP

uDDXXY sskk ...... 22221

uDDDXXY sskk ...... 2211221

Page 6: THE DUMMY VARIABLE TRAP 1 Suppose that you have a regression model with Y depending on a set of ordinary variables X 2,..., X k and a qualitative variable.

6

1 represents the fixed component of Y for the basic category. But again, there is no basic category. Thus the model does not have any logical interpretation.

THE DUMMY VARIABLE TRAP

uDDXXY sskk ...... 22221

uDDDXXY sskk ...... 2211221

Page 7: THE DUMMY VARIABLE TRAP 1 Suppose that you have a regression model with Y depending on a set of ordinary variables X 2,..., X k and a qualitative variable.

7

Mathematically, we have a special case of exact multicollinearity. If there is no omitted category, there is an exact linear relationship between X1 and the dummy variables. The table gives an example where there are 4 categories.

THE DUMMY VARIABLE TRAP

Observation Category X1 D1 D2 D3 D4

1 4 1 0 0 0 12 3 1 0 0 1 03 1 1 1 0 0 04 2 1 0 1 0 05 2 1 0 1 0 06 3 1 0 0 1 07 1 1 1 0 0 08 4 1 0 0 0 1

1

4

1

XDi

i

uDDXXY sskk ...... 22221

uDDDXXY sskk ...... 2211221

uDDDXXXY sskk ...... 22112211

Page 8: THE DUMMY VARIABLE TRAP 1 Suppose that you have a regression model with Y depending on a set of ordinary variables X 2,..., X k and a qualitative variable.

8

X1 is the variable whose coefficient is 1. It is equal to 1 in all observations. Usually we do not write it explicitly because there is no need to do so.

THE DUMMY VARIABLE TRAP

Observation Category X1 D1 D2 D3 D4

1 4 1 0 0 0 12 3 1 0 0 1 03 1 1 1 0 0 04 2 1 0 1 0 05 2 1 0 1 0 06 3 1 0 0 1 07 1 1 1 0 0 08 4 1 0 0 0 1

1

4

1

XDi

i

uDDXXY sskk ...... 22221

uDDDXXY sskk ...... 2211221

uDDDXXXY sskk ...... 22112211

Page 9: THE DUMMY VARIABLE TRAP 1 Suppose that you have a regression model with Y depending on a set of ordinary variables X 2,..., X k and a qualitative variable.

9

If there is an exact linear relationship among a set of the variables, it is impossible in principle to estimate the separate coefficients of those variables. To understand this properly, one needs to use linear algebra.

THE DUMMY VARIABLE TRAP

Observation Category X1 D1 D2 D3 D4

1 4 1 0 0 0 12 3 1 0 0 1 03 1 1 1 0 0 04 2 1 0 1 0 05 2 1 0 1 0 06 3 1 0 0 1 07 1 1 1 0 0 08 4 1 0 0 0 1

1

4

1

XDi

i

uDDXXY sskk ...... 22221

uDDDXXY sskk ...... 2211221

uDDDXXXY sskk ...... 22112211

Page 10: THE DUMMY VARIABLE TRAP 1 Suppose that you have a regression model with Y depending on a set of ordinary variables X 2,..., X k and a qualitative variable.

10

If you tried to run the regression anyway, the regression application should detect the problem and do one of two things. It may simply refuse to run the regression.

THE DUMMY VARIABLE TRAP

Observation Category X1 D1 D2 D3 D4

1 4 1 0 0 0 12 3 1 0 0 1 03 1 1 1 0 0 04 2 1 0 1 0 05 2 1 0 1 0 06 3 1 0 0 1 07 1 1 1 0 0 08 4 1 0 0 0 1

1

4

1

XDi

i

uDDXXY sskk ...... 22221

uDDDXXY sskk ...... 2211221

uDDDXXXY sskk ...... 22112211

Page 11: THE DUMMY VARIABLE TRAP 1 Suppose that you have a regression model with Y depending on a set of ordinary variables X 2,..., X k and a qualitative variable.

11

Alternatively, it may run it, dropping one of the variables in the linear relationship, effectively defining the omitted category by itself.

THE DUMMY VARIABLE TRAP

Observation Category X1 D1 D2 D3 D4

1 4 1 0 0 0 12 3 1 0 0 1 03 1 1 1 0 0 04 2 1 0 1 0 05 2 1 0 1 0 06 3 1 0 0 1 07 1 1 1 0 0 08 4 1 0 0 0 1

1

4

1

XDi

i

uDDXXY sskk ...... 22221

uDDDXXY sskk ...... 2211221

uDDDXXXY sskk ...... 22112211

Page 12: THE DUMMY VARIABLE TRAP 1 Suppose that you have a regression model with Y depending on a set of ordinary variables X 2,..., X k and a qualitative variable.

12

There is another way of avoiding the dummy variable trap. That is to drop the intercept (and X1). There is no longer a problem because there is no longer an exact linear relationship linking the variables.

THE DUMMY VARIABLE TRAP

Observation Category X1 D1 D2 D3 D4

1 4 1 0 0 0 12 3 1 0 0 1 03 1 1 1 0 0 04 2 1 0 1 0 05 2 1 0 1 0 06 3 1 0 0 1 07 1 1 1 0 0 08 4 1 0 0 0 1

1

4

1

XDi

i

uDDXXY sskk ...... 22221

uDDDXXY sskk ...... 2211221

uDDDXXXY sskk ...... 22112211

uDDDXXY sskk ...... 221122

Page 13: THE DUMMY VARIABLE TRAP 1 Suppose that you have a regression model with Y depending on a set of ordinary variables X 2,..., X k and a qualitative variable.

13

The parameters are now the intercepts in the relationship for the individual categories. For example, if the observation relates to category 2, all the dummy variables except D2 will be equal to 0. D2 = 1, and hence the relationship for that observation has intercept 2.

Observation Category X1 D1 D2 D3 D4

1 4 1 0 0 0 12 3 1 0 0 1 03 1 1 1 0 0 04 2 1 0 1 0 05 2 1 0 1 0 06 3 1 0 0 1 07 1 1 1 0 0 08 4 1 0 0 0 1

THE DUMMY VARIABLE TRAP

1

4

1

XDi

i

uDDXXY sskk ...... 22221

uDDDXXY sskk ...... 2211221

uDDDXXXY sskk ...... 22112211

uDDDXXY sskk ...... 221122

Page 14: THE DUMMY VARIABLE TRAP 1 Suppose that you have a regression model with Y depending on a set of ordinary variables X 2,..., X k and a qualitative variable.

Copyright Christopher Dougherty 2012.

These slideshows may be downloaded by anyone, anywhere for personal use.

Subject to respect for copyright and, where appropriate, attribution, they may be

used as a resource for teaching an econometrics course. There is no need to

refer to the author.

The content of this slideshow comes from Section 5.2 of C. Dougherty,

Introduction to Econometrics, fourth edition 2011, Oxford University Press.

Additional (free) resources for both students and instructors may be

downloaded from the OUP Online Resource Centre

http://www.oup.com/uk/orc/bin/9780199567089/.

Individuals studying econometrics on their own who feel that they might benefit

from participation in a formal course should consider the London School of

Economics summer school course

EC212 Introduction to Econometrics

http://www2.lse.ac.uk/study/summerSchools/summerSchool/Home.aspx

or the University of London International Programmes distance learning course

EC2020 Elements of Econometrics

www.londoninternational.ac.uk/lse.

2012.11.05


Recommended