+ All Categories
Home > Documents > COST 11 DUMMY VARIABLE CLASSIFICATION WITH TWO CATEGORIES 1 This sequence explains how you can...

COST 11 DUMMY VARIABLE CLASSIFICATION WITH TWO CATEGORIES 1 This sequence explains how you can...

Date post: 18-Jan-2016
Category:
Upload: christian-banks
View: 219 times
Download: 0 times
Share this document with a friend
31
COST 1 DUMMY VARIABLE CLASSIFICATION WITH TWO CATEGORIES 1 This sequence explains how you can include qualitative explanatory variables in your regression model. N regular school occupational school 1 '
Transcript
Page 1: COST 11 DUMMY VARIABLE CLASSIFICATION WITH TWO CATEGORIES 1 This sequence explains how you can include qualitative explanatory variables in your regression.

COST

1

DUMMY VARIABLE CLASSIFICATION WITH TWO CATEGORIES

1

This sequence explains how you can include qualitative explanatory variables in your regression model.

N

regular schooloccupational school

1'

Page 2: COST 11 DUMMY VARIABLE CLASSIFICATION WITH TWO CATEGORIES 1 This sequence explains how you can include qualitative explanatory variables in your regression.

COST

1

2

Suppose that you have data on the annual recurrent expenditure, COST, and the number of students enrolled, N, for a sample of secondary schools, of which there are two types: regular and occupational.

DUMMY VARIABLE CLASSIFICATION WITH TWO CATEGORIES

N

regular schooloccupational school

1'

Page 3: COST 11 DUMMY VARIABLE CLASSIFICATION WITH TWO CATEGORIES 1 This sequence explains how you can include qualitative explanatory variables in your regression.

COST

1

3

The occupational schools aim to provide skills for specific occupations and they tend to be relatively expensive to run because they need to maintain specialized workshops.

DUMMY VARIABLE CLASSIFICATION WITH TWO CATEGORIES

N

regular schooloccupational school

1'

Page 4: COST 11 DUMMY VARIABLE CLASSIFICATION WITH TWO CATEGORIES 1 This sequence explains how you can include qualitative explanatory variables in your regression.

4

One way of dealing with the difference in the costs would be to run separate regressions for the two types of school.

DUMMY VARIABLE CLASSIFICATION WITH TWO CATEGORIES

COST

1

N

regular schooloccupational school

1'

Page 5: COST 11 DUMMY VARIABLE CLASSIFICATION WITH TWO CATEGORIES 1 This sequence explains how you can include qualitative explanatory variables in your regression.

5

However this would have the drawback that you would be running regressions with two small samples instead of one large one, with an adverse effect on the precision of the estimates of the coefficients.

DUMMY VARIABLE CLASSIFICATION WITH TWO CATEGORIES

COST

1

N

regular schooloccupational school

1'

Page 6: COST 11 DUMMY VARIABLE CLASSIFICATION WITH TWO CATEGORIES 1 This sequence explains how you can include qualitative explanatory variables in your regression.

6

Another way of handling the difference would be to hypothesize that the cost function for occupational schools has an intercept 1' that is greater than that for regular schools.

DUMMY VARIABLE CLASSIFICATION WITH TWO CATEGORIES

N

COST

1

OCC = 0 Regular school COST = 1 + 2N + u

OCC = 1 Occupational school COST = 1' + 2N + u

1'

regular schooloccupational school

Page 7: COST 11 DUMMY VARIABLE CLASSIFICATION WITH TWO CATEGORIES 1 This sequence explains how you can include qualitative explanatory variables in your regression.

7

Effectively, we are hypothesizing that the annual overhead cost is different for the two types of school, but the marginal cost is the same. The marginal cost assumption is not very plausible and we will relax it in due course.

DUMMY VARIABLE CLASSIFICATION WITH TWO CATEGORIES

OCC = 0 Regular school COST = 1 + 2N + u

OCC = 1 Occupational school COST = 1' + 2N + u

N

COST

1

regular schooloccupational school

1'

Page 8: COST 11 DUMMY VARIABLE CLASSIFICATION WITH TWO CATEGORIES 1 This sequence explains how you can include qualitative explanatory variables in your regression.

8

Let us define to be the difference in the intercepts: = 1' – 1.

DUMMY VARIABLE CLASSIFICATION WITH TWO CATEGORIES

OCC = 0 Regular school COST = 1 + 2N + u

OCC = 1 Occupational school COST = 1' + 2N + u

Define = 1' – 1

N

COST

1

regular schooloccupational school

1'

Page 9: COST 11 DUMMY VARIABLE CLASSIFICATION WITH TWO CATEGORIES 1 This sequence explains how you can include qualitative explanatory variables in your regression.

9

Then 1' = 1 + and we can rewrite the cost function for occupational schools as shown.

DUMMY VARIABLE CLASSIFICATION WITH TWO CATEGORIES

OCC = 0 Regular school COST = 1 + 2N + u

OCC = 1 Occupational school COST = 1 + + 2N + u

Define = 1' – 1

1+

N

COST

1occupational schoolregular school

Page 10: COST 11 DUMMY VARIABLE CLASSIFICATION WITH TWO CATEGORIES 1 This sequence explains how you can include qualitative explanatory variables in your regression.

OCC = 0 Regular school COST = 1 + 2N + u

OCC = 1 Occupational school COST = 1 + + 2N + u

Combined equation COST = 1 + OCC + 2N + u

10

We can now combine the two cost functions by defining a dummy variable OCC that has value 0 for regular schools and 1 for occupational schools.

DUMMY VARIABLE CLASSIFICATION WITH TWO CATEGORIES

N

COST

1

1+

occupational schoolregular school

Page 11: COST 11 DUMMY VARIABLE CLASSIFICATION WITH TWO CATEGORIES 1 This sequence explains how you can include qualitative explanatory variables in your regression.

Dummy variables always have two values, 0 or 1. If OCC is equal to 0, the cost function becomes that for regular schools. If OCC is equal to 1, the cost function becomes that for occupational schools.

11

DUMMY VARIABLE CLASSIFICATION WITH TWO CATEGORIES

OCC = 0 Regular school COST = 1 + 2N + u

OCC = 1 Occupational school COST = 1 + + 2N + u

Combined equation COST = 1 + OCC + 2N + u

N

COST

1

1+

occupational schoolregular school

Page 12: COST 11 DUMMY VARIABLE CLASSIFICATION WITH TWO CATEGORIES 1 This sequence explains how you can include qualitative explanatory variables in your regression.

We will now fit a function of this type using actual data for a sample of 74 secondary schools in Shanghai.

12

DUMMY VARIABLE CLASSIFICATION WITH TWO CATEGORIES

-100000

0

100000

200000

300000

400000

500000

600000

0 200 400 600 800 1000 1200

COST

N

occupational schoolregular school

Page 13: COST 11 DUMMY VARIABLE CLASSIFICATION WITH TWO CATEGORIES 1 This sequence explains how you can include qualitative explanatory variables in your regression.

School Type COST N OCC

1 Occupational 345,000 623 1

2 Occupational 537,000 653 1

3 Regular 170,000 400 0

4 Occupational 526.000 663 1

5 Regular 100,000 563 0

6 Regular 28,000 236 0

7 Regular 160,000 307 0

8 Occupational 45,000 173 1

9 Occupational 120,000 146 1

10 Occupational 61,000 99 1

The table shows the data for the first 10 schools in the sample. The annual cost is measured in yuan, one yuan being worth about 20 cents U.S. at the time. N is the number of students in the school.

13

DUMMY VARIABLE CLASSIFICATION WITH TWO CATEGORIES

Page 14: COST 11 DUMMY VARIABLE CLASSIFICATION WITH TWO CATEGORIES 1 This sequence explains how you can include qualitative explanatory variables in your regression.

14

OCC is the dummy variable for the type of school.

DUMMY VARIABLE CLASSIFICATION WITH TWO CATEGORIES

School Type COST N OCC

1 Occupational 345,000 623 1

2 Occupational 537,000 653 1

3 Regular 170,000 400 0

4 Occupational 526.000 663 1

5 Regular 100,000 563 0

6 Regular 28,000 236 0

7 Regular 160,000 307 0

8 Occupational 45,000 173 1

9 Occupational 120,000 146 1

10 Occupational 61,000 99 1

Page 15: COST 11 DUMMY VARIABLE CLASSIFICATION WITH TWO CATEGORIES 1 This sequence explains how you can include qualitative explanatory variables in your regression.

. reg COST N OCC

Source | SS df MS Number of obs = 74---------+------------------------------ F( 2, 71) = 56.86 Model | 9.0582e+11 2 4.5291e+11 Prob > F = 0.0000Residual | 5.6553e+11 71 7.9652e+09 R-squared = 0.6156---------+------------------------------ Adj R-squared = 0.6048 Total | 1.4713e+12 73 2.0155e+10 Root MSE = 89248

------------------------------------------------------------------------------ COST | Coef. Std. Err. t P>|t| [95% Conf. Interval]---------+-------------------------------------------------------------------- N | 331.4493 39.75844 8.337 0.000 252.1732 410.7254 OCC | 133259.1 20827.59 6.398 0.000 91730.06 174788.1 _cons | -33612.55 23573.47 -1.426 0.158 -80616.71 13391.61------------------------------------------------------------------------------

We now run the regression of COST on N and OCC, treating OCC just like any other explanatory variable, despite its artificial nature. The Stata output is shown.

15

DUMMY VARIABLE CLASSIFICATION WITH TWO CATEGORIES

Page 16: COST 11 DUMMY VARIABLE CLASSIFICATION WITH TWO CATEGORIES 1 This sequence explains how you can include qualitative explanatory variables in your regression.

We will begin by interpreting the regression coefficients.

16

DUMMY VARIABLE CLASSIFICATION WITH TWO CATEGORIES

. reg COST N OCC

Source | SS df MS Number of obs = 74---------+------------------------------ F( 2, 71) = 56.86 Model | 9.0582e+11 2 4.5291e+11 Prob > F = 0.0000Residual | 5.6553e+11 71 7.9652e+09 R-squared = 0.6156---------+------------------------------ Adj R-squared = 0.6048 Total | 1.4713e+12 73 2.0155e+10 Root MSE = 89248

------------------------------------------------------------------------------ COST | Coef. Std. Err. t P>|t| [95% Conf. Interval]---------+-------------------------------------------------------------------- N | 331.4493 39.75844 8.337 0.000 252.1732 410.7254 OCC | 133259.1 20827.59 6.398 0.000 91730.06 174788.1 _cons | -33612.55 23573.47 -1.426 0.158 -80616.71 13391.61------------------------------------------------------------------------------

Page 17: COST 11 DUMMY VARIABLE CLASSIFICATION WITH TWO CATEGORIES 1 This sequence explains how you can include qualitative explanatory variables in your regression.

17

The regression results have been rewritten in equation form. From it we can derive cost functions for the two types of school by setting OCC equal to 0 or 1.

DUMMY VARIABLE CLASSIFICATION WITH TWO CATEGORIES

COST = –34,000 + 133,000OCC + 331N^

Page 18: COST 11 DUMMY VARIABLE CLASSIFICATION WITH TWO CATEGORIES 1 This sequence explains how you can include qualitative explanatory variables in your regression.

Regular school(OCC = 0)

COST = –34,000 + 133,000OCC + 331N

COST = –34,000 + 331N^

^

18

If OCC is equal to 0, we get the equation for regular schools, as shown. It implies that the marginal cost per student per year is 331 yuan and that the annual overhead cost is -34,000 yuan.

DUMMY VARIABLE CLASSIFICATION WITH TWO CATEGORIES

Page 19: COST 11 DUMMY VARIABLE CLASSIFICATION WITH TWO CATEGORIES 1 This sequence explains how you can include qualitative explanatory variables in your regression.

19

Obviously having a negative intercept does not make any sense at all and it suggests that the model is misspecified in some way. We will come back to this later.

DUMMY VARIABLE CLASSIFICATION WITH TWO CATEGORIES

Regular school(OCC = 0)

COST = –34,000 + 133,000OCC + 331N

COST = –34,000 + 331N^

^

Page 20: COST 11 DUMMY VARIABLE CLASSIFICATION WITH TWO CATEGORIES 1 This sequence explains how you can include qualitative explanatory variables in your regression.

20

The coefficient of the dummy variable is an estimate of , the extra annual overhead cost of an occupational school.

DUMMY VARIABLE CLASSIFICATION WITH TWO CATEGORIES

Regular school(OCC = 0)

COST = –34,000 + 133,000OCC + 331N

COST = –34,000 + 331N^

^

Page 21: COST 11 DUMMY VARIABLE CLASSIFICATION WITH TWO CATEGORIES 1 This sequence explains how you can include qualitative explanatory variables in your regression.

Regular school(OCC = 0)

Putting OCC equal to 1, we estimate the annual overhead cost of an occupational school to be 99,000 yuan. The marginal cost is the same as for regular schools. It must be, given the model specification.

21

COST = –34,000 + 133,000OCC + 331N

COST = –34,000 + 331N

COST = –34,000 + 133,000 + 331N

= 99,000 + 331N

^

^

^

DUMMY VARIABLE CLASSIFICATION WITH TWO CATEGORIES

Occupational school(OCC = 1)

Page 22: COST 11 DUMMY VARIABLE CLASSIFICATION WITH TWO CATEGORIES 1 This sequence explains how you can include qualitative explanatory variables in your regression.

The scatter diagram shows the data and the two cost functions derived from the regression results.

22

DUMMY VARIABLE CLASSIFICATION WITH TWO CATEGORIES

COST

-100000

0

100000

200000

300000

400000

500000

600000

0 200 400 600 800 1000 1200 N

occupational schoolregular school

Page 23: COST 11 DUMMY VARIABLE CLASSIFICATION WITH TWO CATEGORIES 1 This sequence explains how you can include qualitative explanatory variables in your regression.

In addition to the estimates of the coefficients, the regression results will include standard errors and the usual diagnostic statistics.

23

DUMMY VARIABLE CLASSIFICATION WITH TWO CATEGORIES

. reg COST N OCC

Source | SS df MS Number of obs = 74---------+------------------------------ F( 2, 71) = 56.86 Model | 9.0582e+11 2 4.5291e+11 Prob > F = 0.0000Residual | 5.6553e+11 71 7.9652e+09 R-squared = 0.6156---------+------------------------------ Adj R-squared = 0.6048 Total | 1.4713e+12 73 2.0155e+10 Root MSE = 89248

------------------------------------------------------------------------------ COST | Coef. Std. Err. t P>|t| [95% Conf. Interval]---------+-------------------------------------------------------------------- N | 331.4493 39.75844 8.337 0.000 252.1732 410.7254 OCC | 133259.1 20827.59 6.398 0.000 91730.06 174788.1 _cons | -33612.55 23573.47 -1.426 0.158 -80616.71 13391.61------------------------------------------------------------------------------

Page 24: COST 11 DUMMY VARIABLE CLASSIFICATION WITH TWO CATEGORIES 1 This sequence explains how you can include qualitative explanatory variables in your regression.

We will perform a t test on the coefficient of the dummy variable. Our null hypothesis is H0: = 0 and our alternative hypothesis is H1: 0.

24

DUMMY VARIABLE CLASSIFICATION WITH TWO CATEGORIES

. reg COST N OCC

Source | SS df MS Number of obs = 74---------+------------------------------ F( 2, 71) = 56.86 Model | 9.0582e+11 2 4.5291e+11 Prob > F = 0.0000Residual | 5.6553e+11 71 7.9652e+09 R-squared = 0.6156---------+------------------------------ Adj R-squared = 0.6048 Total | 1.4713e+12 73 2.0155e+10 Root MSE = 89248

------------------------------------------------------------------------------ COST | Coef. Std. Err. t P>|t| [95% Conf. Interval]---------+-------------------------------------------------------------------- N | 331.4493 39.75844 8.337 0.000 252.1732 410.7254 OCC | 133259.1 20827.59 6.398 0.000 91730.06 174788.1 _cons | -33612.55 23573.47 -1.426 0.158 -80616.71 13391.61------------------------------------------------------------------------------

Page 25: COST 11 DUMMY VARIABLE CLASSIFICATION WITH TWO CATEGORIES 1 This sequence explains how you can include qualitative explanatory variables in your regression.

In words, our null hypothesis is that there is no difference in the overhead costs of the two types of school. The t statistic is 6.40, so it is rejected at the 0.1% significance level.

25

DUMMY VARIABLE CLASSIFICATION WITH TWO CATEGORIES

. reg COST N OCC

Source | SS df MS Number of obs = 74---------+------------------------------ F( 2, 71) = 56.86 Model | 9.0582e+11 2 4.5291e+11 Prob > F = 0.0000Residual | 5.6553e+11 71 7.9652e+09 R-squared = 0.6156---------+------------------------------ Adj R-squared = 0.6048 Total | 1.4713e+12 73 2.0155e+10 Root MSE = 89248

------------------------------------------------------------------------------ COST | Coef. Std. Err. t P>|t| [95% Conf. Interval]---------+-------------------------------------------------------------------- N | 331.4493 39.75844 8.337 0.000 252.1732 410.7254 OCC | 133259.1 20827.59 6.398 0.000 91730.06 174788.1 _cons | -33612.55 23573.47 -1.426 0.158 -80616.71 13391.61------------------------------------------------------------------------------

Page 26: COST 11 DUMMY VARIABLE CLASSIFICATION WITH TWO CATEGORIES 1 This sequence explains how you can include qualitative explanatory variables in your regression.

. reg COST N OCC

Source | SS df MS Number of obs = 74---------+------------------------------ F( 2, 71) = 56.86 Model | 9.0582e+11 2 4.5291e+11 Prob > F = 0.0000Residual | 5.6553e+11 71 7.9652e+09 R-squared = 0.6156---------+------------------------------ Adj R-squared = 0.6048 Total | 1.4713e+12 73 2.0155e+10 Root MSE = 89248

------------------------------------------------------------------------------ COST | Coef. Std. Err. t P>|t| [95% Conf. Interval]---------+-------------------------------------------------------------------- N | 331.4493 39.75844 8.337 0.000 252.1732 410.7254 OCC | 133259.1 20827.59 6.398 0.000 91730.06 174788.1 _cons | -33612.55 23573.47 -1.426 0.158 -80616.71 13391.61------------------------------------------------------------------------------

We can perform t tests on the other coefficients in the usual way. The t statistic for the coefficient of N is 8.34, so we conclude that the marginal cost is (very) significantly different from 0.

26

DUMMY VARIABLE CLASSIFICATION WITH TWO CATEGORIES

Page 27: COST 11 DUMMY VARIABLE CLASSIFICATION WITH TWO CATEGORIES 1 This sequence explains how you can include qualitative explanatory variables in your regression.

. reg COST N OCC

Source | SS df MS Number of obs = 74---------+------------------------------ F( 2, 71) = 56.86 Model | 9.0582e+11 2 4.5291e+11 Prob > F = 0.0000Residual | 5.6553e+11 71 7.9652e+09 R-squared = 0.6156---------+------------------------------ Adj R-squared = 0.6048 Total | 1.4713e+12 73 2.0155e+10 Root MSE = 89248

------------------------------------------------------------------------------ COST | Coef. Std. Err. t P>|t| [95% Conf. Interval]---------+-------------------------------------------------------------------- N | 331.4493 39.75844 8.337 0.000 252.1732 410.7254 OCC | 133259.1 20827.59 6.398 0.000 91730.06 174788.1 _cons | -33612.55 23573.47 -1.426 0.158 -80616.71 13391.61------------------------------------------------------------------------------

In the case of the intercept, the t statistic is –1.43, so we do not reject the null hypothesis H0: 1 = 0.

27

DUMMY VARIABLE CLASSIFICATION WITH TWO CATEGORIES

Page 28: COST 11 DUMMY VARIABLE CLASSIFICATION WITH TWO CATEGORIES 1 This sequence explains how you can include qualitative explanatory variables in your regression.

Thus one explanation of the nonsensical negative overhead cost of regular schools might be that they do not actually have any overheads and our estimate is a random number.

28

DUMMY VARIABLE CLASSIFICATION WITH TWO CATEGORIES

. reg COST N OCC

Source | SS df MS Number of obs = 74---------+------------------------------ F( 2, 71) = 56.86 Model | 9.0582e+11 2 4.5291e+11 Prob > F = 0.0000Residual | 5.6553e+11 71 7.9652e+09 R-squared = 0.6156---------+------------------------------ Adj R-squared = 0.6048 Total | 1.4713e+12 73 2.0155e+10 Root MSE = 89248

------------------------------------------------------------------------------ COST | Coef. Std. Err. t P>|t| [95% Conf. Interval]---------+-------------------------------------------------------------------- N | 331.4493 39.75844 8.337 0.000 252.1732 410.7254 OCC | 133259.1 20827.59 6.398 0.000 91730.06 174788.1 _cons | -33612.55 23573.47 -1.426 0.158 -80616.71 13391.61------------------------------------------------------------------------------

Page 29: COST 11 DUMMY VARIABLE CLASSIFICATION WITH TWO CATEGORIES 1 This sequence explains how you can include qualitative explanatory variables in your regression.

. reg COST N OCC

Source | SS df MS Number of obs = 74---------+------------------------------ F( 2, 71) = 56.86 Model | 9.0582e+11 2 4.5291e+11 Prob > F = 0.0000Residual | 5.6553e+11 71 7.9652e+09 R-squared = 0.6156---------+------------------------------ Adj R-squared = 0.6048 Total | 1.4713e+12 73 2.0155e+10 Root MSE = 89248

------------------------------------------------------------------------------ COST | Coef. Std. Err. t P>|t| [95% Conf. Interval]---------+-------------------------------------------------------------------- N | 331.4493 39.75844 8.337 0.000 252.1732 410.7254 OCC | 133259.1 20827.59 6.398 0.000 91730.06 174788.1 _cons | -33612.55 23573.47 -1.426 0.158 -80616.71 13391.61------------------------------------------------------------------------------

A more realistic version of this hypothesis is that 1 is positive but small (as you can see, the 95 percent confidence interval includes positive values) and the error term is responsible for the negative estimate.

29

DUMMY VARIABLE CLASSIFICATION WITH TWO CATEGORIES

Page 30: COST 11 DUMMY VARIABLE CLASSIFICATION WITH TWO CATEGORIES 1 This sequence explains how you can include qualitative explanatory variables in your regression.

As already noted, a further possibility is that the model is misspecified in some way. We will continue to develop the model in the next sequence.

30

DUMMY VARIABLE CLASSIFICATION WITH TWO CATEGORIES

. reg COST N OCC

Source | SS df MS Number of obs = 74---------+------------------------------ F( 2, 71) = 56.86 Model | 9.0582e+11 2 4.5291e+11 Prob > F = 0.0000Residual | 5.6553e+11 71 7.9652e+09 R-squared = 0.6156---------+------------------------------ Adj R-squared = 0.6048 Total | 1.4713e+12 73 2.0155e+10 Root MSE = 89248

------------------------------------------------------------------------------ COST | Coef. Std. Err. t P>|t| [95% Conf. Interval]---------+-------------------------------------------------------------------- N | 331.4493 39.75844 8.337 0.000 252.1732 410.7254 OCC | 133259.1 20827.59 6.398 0.000 91730.06 174788.1 _cons | -33612.55 23573.47 -1.426 0.158 -80616.71 13391.61------------------------------------------------------------------------------

Page 31: COST 11 DUMMY VARIABLE CLASSIFICATION WITH TWO CATEGORIES 1 This sequence explains how you can include qualitative explanatory variables in your regression.

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.1 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.04


Recommended