Beruflich Dokumente
Kultur Dokumente
(SW Ch. 6)
6-1
The TestScore – STR relation looks approximately
linear…
6-2
But the TestScore – average district income relation
looks like it is nonlinear.
6-3
If a relation between Y and X is nonlinear:
• The effect on Y of a change in X depends on the value
of X – that is, the marginal effect of X is not constant
• A linear regression is mis-specified – the functional
form is wrong
• The estimator of the effect on Y of X is biased – it
needn’t even be right on average.
• The solution to this is to estimate a regression
function that is nonlinear in X
6-4
The General Nonlinear Population Regression Function
Assumptions
1. E(ui| X1i,X2i,…,Xki) = 0 (same); implies that f is the
conditional expectation of Y given the X’s.
2. (X1i,…,Xki,Yi) are i.i.d. (same).
3. “enough” moments exist (same idea; the precise
statement depends on specific f).
4. No perfect multicollinearity (same idea; the precise
statement depends on the specific f).
6-5
6-6
Nonlinear Functions of a Single Independent Variable
(SW Section 6.2)
6-7
1. Polynomials in X
Approximate the population regression function by a
polynomial:
Yi = 0 + 1Xi + 2 X i2 +…+ r X ir + ui
6-8
Example: the TestScore – Income relation
Quadratic specification:
Cubic specification:
------------------------------------------------------------------------------
| Robust
testscr | Coef. Std. Err. t P>|t| [95% Conf. Interval]
-------------+----------------------------------------------------------------
avginc | 3.850995 .2680941 14.36 0.000 3.32401 4.377979
avginc2 | -.0423085 .0047803 -8.85 0.000 -.051705 -.0329119
_cons | 607.3017 2.901754 209.29 0.000 601.5978 613.0056
------------------------------------------------------------------------------
6-11
Interpreting the estimated regression function:
(a) Compute “effects” for different values of X
6-12
TestScore = 607.3 + 3.85Incomei – 0.0423(Incomei)2
------------------------------------------------------------------------------
| Robust
test avginc2 avginc3; Execute the test command after running the regression
( 1) avginc2 = 0.0
( 2) avginc3 = 0.0
F( 2, 416) = 37.69
Prob > F = 0.0000
x x
Here’s why: ln(x+x) – ln(x) = ln 1
x x
d ln( x ) 1
(calculus: )
dx x
Numerically:
ln(1.01) = .00995 .01; ln(1.10) = .0953 .10 (sort of)
6-17
Three cases:
6-18
I. Linear-log population regression function
Yi = 0 + 1ln(Xi) + ui (b)
X
now ln(X + X) – ln(X) ,
X
X
so Y 1
X
Y
or 1 (small X)
X / X
6-19
Linear-log case, continued
Yi = 0 + 1ln(Xi) + ui
X
Now 100 = percentage change in X, so a 1%
X
increase in X (multiplying X by 1.01) is associated with
a .011 change in Y.
6-20
Example: TestScore vs. ln(Income)
• First defining the new regressor, ln(Income)
• The model is now linear in ln(Income), so the linear-log
model can be estimated by OLS:
6-22
II. Log-linear population regression function
Y
so 1X
Y
Y / Y
or 1 (small X)
X
6-23
Log-linear case, continued
ln(Yi) = 0 + 1Xi + ui
Y / Y
for small X, 1
X
Y
• Now 100 = percentage change in Y, so a change
Y
in X by one unit (X = 1) is associated with a 1001%
change in Y (Y increases by a factor of 1+1).
• Note: What are the units of ui and the SER?
o fractional (proportional) deviations
o for example, SER = .2 means…
6-24
III. Log-log population regression function
Y X
so 1
Y X
Y / Y
or 1 (small X)
X / X
6-25
Log-log case, continued
ln(Yi) = 0 + 1ln(Xi) + ui
6-26
Example: ln( TestScore) vs. ln( Income)
• First defining a new dependent variable, ln(TestScore),
and the new regressor, ln(Income)
• The model is now a linear regression of ln(TestScore)
against ln(Income), which can be estimated by OLS:
6-27
Neither specification seems to fit as well as the cubic or linear-log
6-28
Summary: Logarithmic transformations
Yi = 0 + 1D1i + 2D2i + ui
6-31
Interpreting the coefficients
Yi = 0 + 1D1i + 2D2i + 3(D1i D2i) + ui
6-32
Example: TestScore, STR, English learners
Let
1 if STR 20 1 if PctEL l0
HiSTR = and HiEL =
0 if STR 20 0 if PctEL 10
• Di is binary, X is continuous
• As specified above, the effect on Y of X (holding
constant D) = 2, which does not depend on D
• To allow the effect of X to depend on D, include the
“interaction term” Di Xi as a regressor:
6-34
Interpreting the coefficients
Yi = 0 + 1Di + 2Xi + 3(Di Xi) + ui
• When HiEL = 0:
TestScore = 682.2 – 0.97STR
• When HiEL = 1,
TestScore = 682.2 – 0.97STR + 5.6 – 1.28STR
= 687.8 – 2.25STR
• Two regression lines: one for each HiSTR group.
• Class size reduction is estimated to have a larger effect
when the percent of English learners is large.
Example, ctd.
6-36
TestScore = 682.2 – 0.97STR + 5.6HiEL – 1.28(STR HiEL)
(11.9) (0.59) (19.5) (0.97)
6-37
• Joint hypothesis that the two regression lines are the
same population coefficient on HiEL = 0 and
population coefficient on STR HiEL = 0:
F = 89.94 (p-value < .001) !!
• Why do we reject the joint hypothesis but neither
individual hypothesis?
• Consequence of high but imperfect multicollinearity:
high correlation between HiEL and STR HiEL
Binary-continuous interactions: the two regression lines
Yi = 0 + 1 + 2Xi + 3Xi + ui
= (0+1) + (2+3)Xi + ui
6-39
6-40
(c) Interactions between two continuous variables
Yi = 0 + 1X1i + 2X2i + ui
6-42
TestScore = 686.3 – 1.12STR – 0.67PctEL + .0012(STR PctEL),
(11.8) (0.59) (0.37) (0.019)
6-44
Application: Nonlinear Effects on Test Scores
of the Student-Teacher Ratio
(SW Section 6.4)
6-47
The TestScore – Income relation
6-49
Question #1:
Investigate by considering a polynomial in STR
6-50
Interpreting the regression function via plots
(preceding regression is labeled (5) in this figure)
6-51
Are the higher order terms in STR statistically
significant?
– .411LunchPCT + 12.12ln(Income)
(.029) (1.80)
6-53
Interpreting the regression functions via plots:
– .411LunchPCT + 12.12ln(Income)
(.029) (1.80)
– .411LunchPCT + 12.12ln(Income)
(.029) (1.80)
6-57
Tests of joint hypotheses:
6-58
Summary: Nonlinear Regression Functions