Sunteți pe pagina 1din 31

SLOPE DUMMY VARIABLES

COST occupational school


regular school
600000

500000

400000

300000

200000

100000

0
0 200 400 600 800 1000 1200 N
-100000

The scatter diagram shows the data for the 74 schools in Shanghai and the cost functions
derived from a regression of COST on N and a dummy variable for the type of curriculum
(occupational / regular).
1
SLOPE DUMMY VARIABLES

COST occupational school


regular school
600000

500000

400000

300000

200000

100000

0
0 200 400 600 800 1000 1200 N
-100000

The specification of the model incorporates the assumption that the marginal cost per
student is the same for occupational and regular schools. Hence the cost functions are
parallel.
2
SLOPE DUMMY VARIABLES

COST occupational school


regular school
600000

500000

400000

300000

200000

100000

0
0 200 400 600 800 1000 1200 N
-100000

However, this is not a realistic assumption. Occupational schools incur expenditure on


training materials that is related to the number of students.

3
SLOPE DUMMY VARIABLES

COST occupational school


regular school
600000

500000

400000

300000

200000

100000

0
0 200 400 600 800 1000 1200 N
-100000

Also, the staff-student ratio has to be higher in occupational schools because workshop
groups cannot be, or at least should not be, as large as academic classes.

4
SLOPE DUMMY VARIABLES

COST occupational school


regular school
600000

500000

400000

300000

200000

100000

0
0 200 400 600 800 1000 1200 N
-100000

Looking at the scatter diagram, you can see that the cost function for the occupational
schools should be steeper, and that for the regular schools should be flatter.

5
SLOPE DUMMY VARIABLES

COST = 1 + OCC + 2N + NOCC + u

We will relax the assumption of the same marginal cost by introducing what is known as a
slope dummy variable. This is NOCC, defined as the product of N and OCC.

6
SLOPE DUMMY VARIABLES

COST = 1 + OCC + 2N + NOCC + u

Regular school COST = 1 + 2N + u


(OCC = NOCC = 0)

In the case of a regular school, OCC is 0 and hence so also is NOCC. The model reduces to
its basic components.

7
SLOPE DUMMY VARIABLES

COST = 1 + OCC + 2N + NOCC + u

Regular school COST = 1 + 2N + u


(OCC = NOCC = 0)

Occupational school COST = (1 + ) + (2 + )N + u


(OCC = 1; NOCC = N)

In the case of an occupational school, OCC is equal to 1 and NOCC is equal to N. The
equation simplifies as shown.

8
SLOPE DUMMY VARIABLES

COST = 1 + OCC + 2N + NOCC + u

Regular school COST = 1 + 2N + u


(OCC = NOCC = 0)

Occupational school COST = (1 + ) + (2 + )N + u


(OCC = 1; NOCC = N)

The model now allows the marginal cost per student to be an amount  greater than that in
regular schools, as well as allowing the overhead costs to be different.

9
SLOPE DUMMY VARIABLES

COST

Occupational


Regular

1 + 

1

The diagram illustrates the model graphically.

10
SLOPE DUMMY VARIABLES

School Type COST  N  OCC NOCC

1 Occupational 345,000 623 1 623


2 Occupational 537,000 653 1 653
3 Regular 170,000 400 0 0
4 Occupational 526.000 663 1 663
5 Regular 100,000 563 0 0
6 Regular 28,000 236 0 0
7 Regular 160,000 307 0 0
8 Occupational 45,000 173 1 173
9 Occupational 120,000 146 1 146
10 Occupational 61,000 99 1 99

Here are the data for the first ten schools. Note the weird way in which NOCC is defined.

11
SLOPE DUMMY VARIABLES

. reg COST N OCC NOCC

Source | SS df MS Number of obs = 74


---------+------------------------------ F( 3, 70) = 49.64
Model | 1.0009e+12 3 3.3363e+11 Prob > F = 0.0000
Residual | 4.7045e+11 70 6.7207e+09 R-squared = 0.6803
---------+------------------------------ Adj R-squared = 0.6666
Total | 1.4713e+12 73 2.0155e+10 Root MSE = 81980

------------------------------------------------------------------------------
COST | Coef. Std. Err. t P>|t| [95% Conf. Interval]
---------+--------------------------------------------------------------------
N | 152.2982 60.01932 2.537 0.013 32.59349 272.003
OCC | -3501.177 41085.46 -0.085 0.932 -85443.55 78441.19
NOCC | 284.4786 75.63211 3.761 0.000 133.6351 435.3221
_cons | 51475.25 31314.84 1.644 0.105 -10980.24 113930.7
------------------------------------------------------------------------------

Weird or not, the procedure works very well. Here is the regression output using the full
sample of 74 schools. We will begin by interpreting the regression coefficients.

12
SLOPE DUMMY VARIABLES

^
COST = 51,000 – 4,000OCC + 152N + 284NOCC

Here is the regression in equation form.

13
SLOPE DUMMY VARIABLES

^
COST = 51,000 – 4,000OCC + 152N + 284NOCC

^
Regular school COST = 51,000 + 152N
(OCC = NOCC = 0)

Putting OCC, and hence NOCC, equal to 0, we get the cost function for regular schools. We
estimate that their annual overhead costs are 51,000 yuan and their annual marginal cost
per student is 152 yuan.
14
SLOPE DUMMY VARIABLES

^
COST = 51,000 – 4,000OCC + 152N + 284NOCC

^
Regular school COST = 51,000 + 152N
(OCC = NOCC = 0)

^
Occupational school COST = 51,000 – 4,000 + 152N + 284N
(OCC = 1; NOCC = N) = 47,000 + 436N

Putting OCC equal to 1, and hence NOCC equal to N, we estimate that the annual overhead
costs of the occupational schools are 47,000 yuan and the annual marginal cost per student
is 436 yuan.
15
SLOPE DUMMY VARIABLES

COST occupational school


regular school
600000

500000

400000

300000

200000

100000

0
0 200 400 600 800 1000 1200 N
-100000

You can see that the cost functions fit the data much better than before and that the real
difference is in the marginal cost, not the overhead cost.

16
SLOPE DUMMY VARIABLES

COST occupational school


regular school
600000

500000

400000

300000

200000

100000

0
0 200 400 600 800 1000 1200 N
-100000

Now we can see why we had a nonsensical negative estimate of the overhead cost of a
regular school in previous specifications.

17
SLOPE DUMMY VARIABLES

COST occupational school


regular school
600000

500000

400000

300000

200000

100000

0
0 200 400 600 800 1000 1200 N
-100000

The assumption of the same marginal cost led to an estimate of the marginal cost that was
a compromise between the marginal costs of occupational and regular schools.

18
SLOPE DUMMY VARIABLES

COST occupational school


regular school
600000

500000

400000

300000

200000

100000

0
0 200 400 600 800 1000 1200 N
-100000

The cost function for regular schools was too steep and as a consequence the intercept
was underestimated, actually becoming negative and indicating that something must be
wrong with the specification of the model.
19
SLOPE DUMMY VARIABLES

. reg COST N OCC NOCC

Source | SS df MS Number of obs = 74


---------+------------------------------ F( 3, 70) = 49.64
Model | 1.0009e+12 3 3.3363e+11 Prob > F = 0.0000
Residual | 4.7045e+11 70 6.7207e+09 R-squared = 0.6803
---------+------------------------------ Adj R-squared = 0.6666
Total | 1.4713e+12 73 2.0155e+10 Root MSE = 81980

------------------------------------------------------------------------------
COST | Coef. Std. Err. t P>|t| [95% Conf. Interval]
---------+--------------------------------------------------------------------
N | 152.2982 60.01932 2.537 0.013 32.59349 272.003
OCC | -3501.177 41085.46 -0.085 0.932 -85443.55 78441.19
NOCC | 284.4786 75.63211 3.761 0.000 133.6351 435.3221
_cons | 51475.25 31314.84 1.644 0.105 -10980.24 113930.7
------------------------------------------------------------------------------

We can perform t tests as usual. The t statistic for the coefficient of NOCC is 3.76, so the
marginal cost per student in an occupational school is significantly higher than that in a
regular school.
20
SLOPE DUMMY VARIABLES

. reg COST N OCC NOCC

Source | SS df MS Number of obs = 74


---------+------------------------------ F( 3, 70) = 49.64
Model | 1.0009e+12 3 3.3363e+11 Prob > F = 0.0000
Residual | 4.7045e+11 70 6.7207e+09 R-squared = 0.6803
---------+------------------------------ Adj R-squared = 0.6666
Total | 1.4713e+12 73 2.0155e+10 Root MSE = 81980

------------------------------------------------------------------------------
COST | Coef. Std. Err. t P>|t| [95% Conf. Interval]
---------+--------------------------------------------------------------------
N | 152.2982 60.01932 2.537 0.013 32.59349 272.003
OCC | -3501.177 41085.46 -0.085 0.932 -85443.55 78441.19
NOCC | 284.4786 75.63211 3.761 0.000 133.6351 435.3221
_cons | 51475.25 31314.84 1.644 0.105 -10980.24 113930.7
------------------------------------------------------------------------------

The coefficient of OCC is now negative, suggesting that the overhead costs of occupational
schools are actually lower than those of regular schools.

21
SLOPE DUMMY VARIABLES

. reg COST N OCC NOCC

Source | SS df MS Number of obs = 74


---------+------------------------------ F( 3, 70) = 49.64
Model | 1.0009e+12 3 3.3363e+11 Prob > F = 0.0000
Residual | 4.7045e+11 70 6.7207e+09 R-squared = 0.6803
---------+------------------------------ Adj R-squared = 0.6666
Total | 1.4713e+12 73 2.0155e+10 Root MSE = 81980

------------------------------------------------------------------------------
COST | Coef. Std. Err. t P>|t| [95% Conf. Interval]
---------+--------------------------------------------------------------------
N | 152.2982 60.01932 2.537 0.013 32.59349 272.003
OCC | -3501.177 41085.46 -0.085 0.932 -85443.55 78441.19
NOCC | 284.4786 75.63211 3.761 0.000 133.6351 435.3221
_cons | 51475.25 31314.84 1.644 0.105 -10980.24 113930.7
------------------------------------------------------------------------------

This is unlikely. However, the t statistic is only -0.09, so we do not reject the null
hypothesis that the overhead costs of the two types of school are the same.

22
SLOPE DUMMY VARIABLES

. reg COST N OCC NOCC

Source | SS df MS Number of obs = 74


---------+------------------------------ F( 3, 70) = 49.64
Model | 1.0009e+12 3 3.3363e+11 Prob > F = 0.0000
Residual | 4.7045e+11 70 6.7207e+09 R-squared = 0.6803
---------+------------------------------ Adj R-squared = 0.6666
Total | 1.4713e+12 73 2.0155e+10 Root MSE = 81980
------------------------------------------------------------------------------

. reg COST N

Source | SS df MS Number of obs = 74


---------+------------------------------ F( 1, 72) = 46.82
Model | 5.7974e+11 1 5.7974e+11 Prob > F = 0.0000
Residual | 8.9160e+11 72 1.2383e+10 R-squared = 0.3940
---------+------------------------------ Adj R-squared = 0.3856
Total | 1.4713e+12 73 2.0155e+10 Root MSE = 1.1e+05
------------------------------------------------------------------------------

We can also perform an F test of the joint explanatory power of the dummy variables,
comparing RSS when the dummy variables are included with RSS when they are not.

23
SLOPE DUMMY VARIABLES

. reg COST N OCC NOCC

Source | SS df MS Number of obs = 74


---------+------------------------------ F( 3, 70) = 49.64
Model | 1.0009e+12 3 3.3363e+11 Prob > F = 0.0000
Residual | 4.7045e+11 70 6.7207e+09 R-squared = 0.6803
---------+------------------------------ Adj R-squared = 0.6666
Total | 1.4713e+12 73 2.0155e+10 Root MSE = 81980
------------------------------------------------------------------------------

. reg COST N

Source | SS df MS Number of obs = 74


---------+------------------------------ F( 1, 72) = 46.82
Model | 5.7974e+11 1 5.7974e+11 Prob > F = 0.0000
Residual | 8.9160e+11 72 1.2383e+10 R-squared = 0.3940
---------+------------------------------ Adj R-squared = 0.3856
Total | 1.4713e+12 73 2.0155e+10 Root MSE = 1.1e+05
------------------------------------------------------------------------------

The null hypothesis is that the coefficients of OCC and NOCC are both equal to 0. The
alternative hypothesis is that one or both are nonzero.

24
SLOPE DUMMY VARIABLES

. reg COST N OCC NOCC

Source | SS df MS Number of obs = 74


---------+------------------------------ F( 3, 70) = 49.64
Model | 1.0009e+12 3 3.3363e+11 Prob > F = 0.0000
Residual | 4.7045e+11 70 6.7207e+09 R-squared = 0.6803
---------+------------------------------ Adj R-squared = 0.6666
Total | 1.4713e+12 73 2.0155e+10 Root MSE = 81980
------------------------------------------------------------------------------

. reg COST N

Source | SS df MS Number of obs = 74


---------+------------------------------ F( 1, 72) = 46.82
Model | 5.7974e+11 1 5.7974e+11 Prob > F = 0.0000
Residual | 8.9160e+11 72 1.2383e+10 R-squared = 0.3940
---------+------------------------------ Adj R-squared = 0.3856
Total | 1.4713e+12 73 2.0155e+10 Root MSE = 1.1e+05
------------------------------------------------------------------------------

(8.92  1011  4.70  1011 ) / 2


F (2,70)   31.4
4.70  1011 / 70

The improvement in the fit on adding the dummy variables is the reduction in RSS.

25
SLOPE DUMMY VARIABLES

. reg COST N OCC NOCC

Source | SS df MS Number of obs = 74


---------+------------------------------ F( 3, 70) = 49.64
Model | 1.0009e+12 3 3.3363e+11 Prob > F = 0.0000
Residual | 4.7045e+11 70 6.7207e+09 R-squared = 0.6803
---------+------------------------------ Adj R-squared = 0.6666
Total | 1.4713e+12 73 2.0155e+10 Root MSE = 81980
------------------------------------------------------------------------------

. reg COST N

Source | SS df MS Number of obs = 74


---------+------------------------------ F( 1, 72) = 46.82
Model | 5.7974e+11 1 5.7974e+11 Prob > F = 0.0000
Residual | 8.9160e+11 72 1.2383e+10 R-squared = 0.3940
---------+------------------------------ Adj R-squared = 0.3856
Total | 1.4713e+12 73 2.0155e+10 Root MSE = 1.1e+05
------------------------------------------------------------------------------

(8.92  1011  4.70  1011 ) / 2


F (2,70)   31.4
4.70  1011 / 70

The cost is 2 because 2 extra parameters, the coefficients of the dummy variables, have
been estimated, and as a consequence the number of degrees of freedom remaining has
been reduced from 72 to 70.
26
SLOPE DUMMY VARIABLES

. reg COST N OCC NOCC

Source | SS df MS Number of obs = 74


---------+------------------------------ F( 3, 70) = 49.64
Model | 1.0009e+12 3 3.3363e+11 Prob > F = 0.0000
Residual | 4.7045e+11 70 6.7207e+09 R-squared = 0.6803
---------+------------------------------ Adj R-squared = 0.6666
Total | 1.4713e+12 73 2.0155e+10 Root MSE = 81980
------------------------------------------------------------------------------

. reg COST N

Source | SS df MS Number of obs = 74


---------+------------------------------ F( 1, 72) = 46.82
Model | 5.7974e+11 1 5.7974e+11 Prob > F = 0.0000
Residual | 8.9160e+11 72 1.2383e+10 R-squared = 0.3940
---------+------------------------------ Adj R-squared = 0.3856
Total | 1.4713e+12 73 2.0155e+10 Root MSE = 1.1e+05
------------------------------------------------------------------------------

(8.92  1011  4.70  1011 ) / 2


F (2,70)   31.4
4.70  1011 / 70

The first component of the denominator is RSS after the dummies have been added.

27
SLOPE DUMMY VARIABLES

. reg COST N OCC NOCC

Source | SS df MS Number of obs = 74


---------+------------------------------ F( 3, 70) = 49.64
Model | 1.0009e+12 3 3.3363e+11 Prob > F = 0.0000
Residual | 4.7045e+11 70 6.7207e+09 R-squared = 0.6803
---------+------------------------------ Adj R-squared = 0.6666
Total | 1.4713e+12 73 2.0155e+10 Root MSE = 81980
------------------------------------------------------------------------------

. reg COST N

Source | SS df MS Number of obs = 74


---------+------------------------------ F( 1, 72) = 46.82
Model | 5.7974e+11 1 5.7974e+11 Prob > F = 0.0000
Residual | 8.9160e+11 72 1.2383e+10 R-squared = 0.3940
---------+------------------------------ Adj R-squared = 0.3856
Total | 1.4713e+12 73 2.0155e+10 Root MSE = 1.1e+05
------------------------------------------------------------------------------

(8.92  1011  4.70  1011 ) / 2


F (2,70)   31.4
4.70  1011 / 70

The denominator is RSS after the dummies have been added, divided by the number of
degrees of freedom remaining. This is 70 because there are 74 observations and 4
parameters have been estimated.
28
SLOPE DUMMY VARIABLES

. reg COST N OCC NOCC

Source | SS df MS Number of obs = 74


---------+------------------------------ F( 3, 70) = 49.64
Model | 1.0009e+12 3 3.3363e+11 Prob > F = 0.0000
Residual | 4.7045e+11 70 6.7207e+09 R-squared = 0.6803
---------+------------------------------ Adj R-squared = 0.6666
Total | 1.4713e+12 73 2.0155e+10 Root MSE = 81980
------------------------------------------------------------------------------

. reg COST N

Source | SS df MS Number of obs = 74


---------+------------------------------ F( 1, 72) = 46.82
Model | 5.7974e+11 1 5.7974e+11 Prob > F = 0.0000
Residual | 8.9160e+11 72 1.2383e+10 R-squared = 0.3940
---------+------------------------------ Adj R-squared = 0.3856
Total | 1.4713e+12 73 2.0155e+10 Root MSE = 1.1e+05
------------------------------------------------------------------------------

(8.92  1011  4.70  1011 ) / 2


F (2,70)   31.4 F (2,70)crit, 0.1%  7.6
4.70  1011 / 70

The F statistic is therefore 31.4. The critical vale of F(2,70) at the 0.1 percent level is 7.6.

29
SLOPE DUMMY VARIABLES

. reg COST N OCC NOCC

Source | SS df MS Number of obs = 74


---------+------------------------------ F( 3, 70) = 49.64
Model | 1.0009e+12 3 3.3363e+11 Prob > F = 0.0000
Residual | 4.7045e+11 70 6.7207e+09 R-squared = 0.6803
---------+------------------------------ Adj R-squared = 0.6666
Total | 1.4713e+12 73 2.0155e+10 Root MSE = 81980
------------------------------------------------------------------------------

. reg COST N

Source | SS df MS Number of obs = 74


---------+------------------------------ F( 1, 72) = 46.82
Model | 5.7974e+11 1 5.7974e+11 Prob > F = 0.0000
Residual | 8.9160e+11 72 1.2383e+10 R-squared = 0.3940
---------+------------------------------ Adj R-squared = 0.3856
Total | 1.4713e+12 73 2.0155e+10 Root MSE = 1.1e+05
------------------------------------------------------------------------------

(8.92  1011  4.70  1011 ) / 2


F (2,70)   31.4 F (2,70)crit, 0.1%  7.6
4.70  1011 / 70

Thus we conclude that at least one of the dummy variable coefficients is different from 0.
We knew this already from the t tests, so in this case the F test does not actually add
anything.
30
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.3 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

S-ar putea să vă placă și