Lecture 4
Lecture 4
Lecture 4
Chapter 8
Nonlinear Regression
Functions
Assumptions
1. E(ui| X1i, X2i,…, Xki) = 0 (same), so f is the conditional expectation
of Y given the X’s.
2. (X1i,…, Xki, Yi) are i.i.d. (same).
3. Big outliers are rare (same idea; the precise mathematical condition depends
on the specific f ).
4. No perfect multicollinearity (same idea; the precise statement depends on
the specific f ).
The expected difference in Y associated with a difference in X1, holding X2,…,
Xk constant is
ΔY = f (X1 + ΔX1, X2,…, Xk) – f (X1, X2,…, Xk)
Copyright © 2019 Pearson Education Ltd. All Rights Reserved.
Key Concept 8.1: The Expected Change on Y of a
Change in X1 in the Nonlinear Regression Model (8.3)
The expected change in Y, ΔY, associated with the change in X1, ΔX1,
holding X2,…, Xk constant, is the difference between the value of the
population regression function before and after changing X1, holding
X2,…, Xk constant. That is, the expected change in Y is the difference:
ΔY = f (X1 + Δ X1, X2,…, Xk) – f (X1, X2,…, Xk). (8.4)
Yˆ = fˆ ( X 1 + X 1 , X 2 , , X k ) − fˆ ( X 1 , X 2 , , X k ). (8.5)
Yi = 0 + 1 X i + 2 X i2 + + r X ir + ui
• This is just the linear multiple regression model – except that the
regressors are powers of X!
• Estimation, hypothesis testing, etc. proceeds as in the multiple
regression model using OLS
• The coefficients are difficult to interpret, but the regression
function itself is interpretable
------------------------------------------------------------------------------
| 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
------------------------------------------------------------------------------
Test the null hypothesis of linearity against the alternative that the
regression function is a quadratic.…
Copyright © 2019 Pearson Education Ltd. All Rights Reserved.
Interpreting the estimated regression
function: (1 of 3)
(a) Plot the predicted values
𝑇𝑒𝑠𝑡𝑆𝑐𝑜𝑟𝑒 = 607.3 + 3.85𝐼𝑛𝑐𝑜𝑚𝑒𝑖 − 0.0423(𝐼𝑛𝑐𝑜𝑚𝑒𝑖 )2
(2.9) (0.27) (0.0048)
------------------------------------------------------------------------------
| Robust
testscr | Coef. Std. Err. t P>|t| [95% Conf. Interval]
-------------+----------------------------------------------------------------
avginc | 5.018677 .7073505 7.10 0.000 3.628251 6.409104
avginc2 | -.0958052 .0289537 -3.31 0.001 -.1527191 -.0388913
avginc3 | .0006855 .0003471 1.98 0.049 3.27e-06 .0013677
_cons | 600.079 5.102062 117.61 0.000 590.0499 610.108
------------------------------------------------------------------------------
Testing the null hypothesis of linearity, against the alternative that the population
regression is quadratic and/or cubic, that is, it is a polynomial of degree up to 3:
H0: population coefficients on Income2 and Income3 = 0
H1: at least one of these coefficients is nonzero.
test avginc2 avginc3
( 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 )
Copyright © 2019 Pearson Education Ltd. All Rights Reserved.
The three log regression specifications:
Yi = β0 + β1ln(Xi) + ui
for small ΔX,
Y
1
X /X
X
Now 100 = percentage change in X , so a 1% increase
X
in X ( multiplying X by 1.01) is associated with a .01 1
change in Y .
Y
so 1X
Y
Y /Y
or 1 (small X )
X
ln(Yi ) = 0 + 1 X i + ui
Y /Y
for small X , 1
X
Y
• Now 100 = percentage change in Y , so a change in X by
Y
one unit ( X = 1) is associated with a 100 1 % change in Y .
Y X
so 1
Y X
Y /Y
or 1 (small X )
X /X
ln(Yi) = β0 + β1ln(Xi) + ui
for small ΔX,
Y /Y
1
X /X
Y X
Now 100 = percentage change in Y , and 100 = percentage
Y X
change in X , so a 1% change in X is associated with a 1 %
change in Y .
ln( 𝑇𝑒𝑠𝑡𝑆𝑐𝑜𝑟𝑒) = 6.336 + 0.0554 × ln( 𝐼𝑛𝑐𝑜𝑚𝑒𝑖 )
(0.006) (0.0021)
𝑇𝑒𝑠𝑡𝑆𝑐𝑜𝑟𝑒 = 664.1 − 18.2𝐻𝑖𝐸𝐿 − 1.9𝐻𝑖𝑆𝑇𝑅 − 3.5(𝐻𝑖𝑆𝑇𝑅 × 𝐻𝑖𝐸𝐿)
(1.4) (2.3) (1.9) (3.1)
𝑇𝑒𝑠𝑡𝑆𝑐𝑜𝑟𝑒 = 664.1 − 18.2𝐻𝑖𝐸𝐿 − 1.9𝐻𝑖𝑆𝑇𝑅 − 3.5(𝐻𝑖𝑆𝑇𝑅 × 𝐻𝑖𝐸𝐿)
(1.4) (2.3) (1.9) (3.1)
• When 𝐻𝑖𝐸𝐿 = 0:
𝑇𝑒𝑠𝑡𝑆𝑐𝑜𝑟𝑒 = 682.2 − 0.97𝑆𝑇𝑅
• When 𝐻𝑖𝐸𝐿 = 1,
𝑇𝑒𝑠𝑡𝑆𝑐𝑜𝑟𝑒 = 682.2 − 0.97𝑆𝑇𝑅 + 5.6 − 1.28𝑆𝑇𝑅
𝑇𝑒𝑠𝑡𝑆𝑐𝑜𝑟𝑒 = 687.8 − 2.25𝑆𝑇𝑅
• The two regression lines have the same slope ↔ the coefficient
on STR×HiEL is zero: t = –1.28/0.97 = –1.32
• The two regression lines have the same intercept ↔ the
coefficient on HiEL is zero: t = –5.6/19.5 = 0.29
• 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) (!!)
• We reject the joint hypothesis but neither individual hypothesis
(how can this be?)
Copyright © 2019 Pearson Education Ltd. All Rights Reserved.
(c) Interactions between two continuous
variables
Yi = β0 + β1X1i + β2X2i + ui
• X1, X2 are continuous
• As specified, the effect of X1 doesn’t depend on X2
• As specified, the effect of X2 doesn’t depend on X1
• To allow the effect of X1 to depend on X2, include the
“interaction term” X1i × X2i as a regressor:
Yi = β0 + β1X1i + β2X2i + β3(X1i × X2i) + ui
TestScore
= −1.12 + .0012 PctEL
STR
TestScore
PctEL STR
0 –1.12
20% –1.12 + .0012 × 20 = –1.10
Copyright © 2019 Pearson Education Ltd. All Rights Reserved.
Example: TestScore, STR, PctEL (2 of 2)
𝑇𝑒𝑠𝑡𝑆𝑐𝑜𝑟𝑒 = 686.3 − 1.12𝑆𝑇𝑅 − 0.67𝑃𝑐𝑡𝐸𝐿 + .0012(𝑆𝑇𝑅 × 𝑃𝑐𝑡𝐸𝐿),
(11.8) (0.59) (0.37) (0.019)