Introduction to Econometrics- Stock & Watson -Ch 6 Slides.doc

Embed Size (px)

Citation preview

  • 8/14/2019 Introduction to Econometrics- Stock & Watson -Ch 6 Slides.doc

    1/59

    Nonlinear Regression Functions

    (SW Ch. 6)

    Everything so far has been linear in theXs

    The approximation that the regression function islinear might be good for some variables, but not for

    others.

    The multiple regression framework can be extended tohandle regression functions that are nonlinear in one

    or moreX.

    6-

  • 8/14/2019 Introduction to Econometrics- Stock & Watson -Ch 6 Slides.doc

    2/59

    The TestScore! STRrelation looks approximately

    linear"

    6-#

  • 8/14/2019 Introduction to Econometrics- Stock & Watson -Ch 6 Slides.doc

    3/59

    $ut theTestScore! average district income relation

    looks like it is nonlinear.

    6-%

  • 8/14/2019 Introduction to Econometrics- Stock & Watson -Ch 6 Slides.doc

    4/59

    &f a relation between YandXis nonlinear'

    The effect on Yof a change inXdepends on the valueofX! that is, the marginal effect ofXis not constant

    ( linear regression is mis-specified ! the functionalform is wrong

    The estimator of the effect on YofXis biased ! itneednt even be right on average.

    The solution to this is to estimate a regressionfunction that is nonlinear inX

    6-)

  • 8/14/2019 Introduction to Econometrics- Stock & Watson -Ch 6 Slides.doc

    5/59

    The General Nonlinear Population Regression Function

    Yi*f+Xi,X#i,",Xki ui, i* ,", n

    Assumptions

    . E+uiXi,X#i,",Xki * / +same0 implies thatfis the

    conditional expectation of Ygiven theXs.#. +Xi,",Xki,Yi are i.i.d. +same.

    %. 1enough2 moments exist +same idea0 the precise

    statement depends on specificf.

    ). 3o perfect multicollinearity +same idea0 the precise

    statement depends on the specificf.

    6-4

  • 8/14/2019 Introduction to Econometrics- Stock & Watson -Ch 6 Slides.doc

    6/59

    6-6

  • 8/14/2019 Introduction to Econometrics- Stock & Watson -Ch 6 Slides.doc

    7/59

    Nonlinear Functions of a Single Independent Variale

    (SW Section 6.!)

    5ell look at two complementary approaches'

    . olynomials inX

    The population regression function is approximated

    by a 7uadratic, cubic, or higher-degree polynomial#. 8ogarithmic transformations

    Yand9orXis transformed by taking its logarithm

    this gives a 1percentages2 interpretation that makessense in many applications

    6-:

  • 8/14/2019 Introduction to Econometrics- Stock & Watson -Ch 6 Slides.doc

    8/59

  • 8/14/2019 Introduction to Econometrics- Stock & Watson -Ch 6 Slides.doc

    9/59

    Example' the TestScore!Incomerelation

    Incomei* average district income in the ithdistrict

    +thousdand dollars per capita

    @uadratic specification'

    TestScorei* / Incomei #+Incomei# ui

    Aubic specification'

    TestScorei* / Incomei #+Incomei#

    %+Incomei% ui

    6-B

  • 8/14/2019 Introduction to Econometrics- Stock & Watson -Ch 6 Slides.doc

    10/59

    Estimation of the quaratic specification in ST!T!

    generate avginc2 = avginc*avginc; Create a new regressorreg testscr avginc avginc2, r;

    Regression with robust standard errors Number of obs = 420 F( 2, 4!" = 42#$%2 &rob ' F = 0$0000 Rs)uared = 0$%%2 Root +- = 2$!24

    . Robust testscr . Coef$ td$ -rr$ t &'.t. /%1 Conf$ nterva35 avginc . 6$#%0% $2#04 4$6 0$000 6$6240 4$6!!! avginc2 . $04260#% $004!#06 #$#% 0$000 $0%!0% $062 7cons . 0!$60! 2$0!%4 20$2 0$000 0$%!# 6$00%

    The t-statistic onIncome#is -?.?4, so the hypothesis of

    linearity is re;ected against the 7uadratic alternative at the

    C significance level. 6-/

  • 8/14/2019 Introduction to Econometrics- Stock & Watson -Ch 6 Slides.doc

    11/59

    Interpreting the estimate regression function'

    +a lot the predicted values

    TestScore* 6/:.% %.?4Incomei! /./)#%+Incomei#

    +#.B +/.#: +/.//)?

    6-

  • 8/14/2019 Introduction to Econometrics- Stock & Watson -Ch 6 Slides.doc

    12/59

    Interpreting the estimate regression function'

    +a Aompute 1effects2 for different values ofX

    TestScore* 6/:.% %.?4Incomei! /./)#%+Incomei

    #

    +#.B +/.#: +/.//)?

    redicted change in TestScorefor a change in income to

    D6,/// from D4,/// per capita'

    TestScore* 6/:.% %.?46 ! /./)#%6#

    ! +6/:.% %.?44 ! /./)#%4#

    * %.)

    6-#

  • 8/14/2019 Introduction to Econometrics- Stock & Watson -Ch 6 Slides.doc

    13/59

    TestScore* 6/:.% %.?4Incomei! /./)#%+Incomei#

    redicted 1effects2 for different values ofX

    Ahange inIncome+thD per capita TestScore

    from 4 to 6 %.)from #4 to #6 .:from )4 to )6 /./

    The 1effect2 of a change in income is greater at low than

    high income levels +perhaps, a declining marginal benefit

    of an increase in school budgets"aution# 5hat about a change from 64 to 66

    Font extrapolate outside the range of the data.

    6-%

  • 8/14/2019 Introduction to Econometrics- Stock & Watson -Ch 6 Slides.doc

    14/59

    Estimation of the cu$ic specification in ST!T!

    gen avginc6 = avginc*avginc2; Create the cubic regressorreg testscr avginc avginc2 avginc6, r;

    Regression with robust standard errors Number of obs = 420 F( 6, 4" = 2!0$# &rob ' F = 0$0000 Rs)uared = 0$%%#4 Root +- = 2$!0!

    . Robust

    testscr . Coef$ td$ -rr$ t &'.t. /%1 Conf$ nterva35 avginc . %$0#!! $!0!6%0% !$0 0$000 6$2#2% $4004 avginc2 . $0%#0%2 $02#%6! 6$6 0$00 $%2! $06##6 avginc6 . $000#%% $00064! $# 0$04 6$2!e0 $006!!

    7cons . 00$0! %$0202 !$ 0$000 %0$04 0$0#

    The cubic term is statistically significant at the 4C, but

    not C, level6-)

  • 8/14/2019 Introduction to Econometrics- Stock & Watson -Ch 6 Slides.doc

    15/59

    Testing the null hypothesis of linearity, against the

    alternative that the population regression is 7uadratic

    and9or cubic, that is, it is a polynomial of degree up to %'

    %/' popn coefficients onIncome#andIncome%* /

    %' at least one of these coefficients is nonGero.

    test avginc2 avginc6; -8ecute the test command after running the regression

    ( " avginc2 = 0$0( 2" avginc6 = 0$0

    F( 2, 4" = 6!$

    &rob ' F = 0$0000

    The hypothesis that the population regression is linear is

    re;ected at the C significance level against the

    alternative that it is a polynomial of degree up to %.6-4

  • 8/14/2019 Introduction to Econometrics- Stock & Watson -Ch 6 Slides.doc

    16/59

  • 8/14/2019 Introduction to Econometrics- Stock & Watson -Ch 6 Slides.doc

    17/59

    o&r use moel selection criteria +ma'$e later

    !. &ogarithmic functions of Yand'orX

    ln+X * the natural logarithm ofX

    8ogarithmic transforms permit modeling relationsin 1percentage2 terms +like elasticities, rather than

    linearly.

    %ere(s )h'' ln+xx ! ln+x * ln x

    x

    + x

    x

    +calculus'ln+ , x

    x x=

    Numericall''

    ln+./ * .//BB4 ./0 ln+./ * ./B4% ./ +sort of

    6-:

  • 8/14/2019 Introduction to Econometrics- Stock & Watson -Ch 6 Slides.doc

    18/59

  • 8/14/2019 Introduction to Econometrics- Stock & Watson -Ch 6 Slides.doc

    19/59

  • 8/14/2019 Introduction to Econometrics- Stock & Watson -Ch 6 Slides.doc

    20/59

    *inear+log case, continue

    Yi* / ln+Xi ui

    for small X,

    9

    Y

    X X

    3ow //X

    X

    * percentage change inX, so a 1%

    increase in X (multiplying X by ".") is associated with

    a ." "change in Y.

    6-#/

  • 8/14/2019 Introduction to Econometrics- Stock & Watson -Ch 6 Slides.doc

    21/59

    Example- TestScore .s/ ln0Income1

    Kirst defining the new regressor, ln+Income

    The model is now linear in ln+Income, so the linear-logmodel can be estimated by =8>'

    TestScore* 44:.? %6.)#ln+Incomei

    +%.? +.)/

    so a C increase inIncomeis associated with an

    increase in TestScoreof /.%6 points on the test.

    >tandard errors, confidence intervals,R#! all theusual tools of regression apply here.

    How does this compare to the cubic model

    6-#

  • 8/14/2019 Introduction to Econometrics- Stock & Watson -Ch 6 Slides.doc

    22/59

    TestScore* 44:.? %6.)#ln+Incomei

    6-##

  • 8/14/2019 Introduction to Econometrics- Stock & Watson -Ch 6 Slides.doc

    23/59

    II. &oglinear population regression function

    ln+Yi * / Xi ui +b

    3ow changeX' ln+Y Y * / +X X +a

    >ubtract +a ! +b' ln+Y Y ! ln+Y * X

    soY

    Y

    X

    or 9Y Y

    X

    +small X

    6-#%

  • 8/14/2019 Introduction to Econometrics- Stock & Watson -Ch 6 Slides.doc

    24/59

    *og+linear case, continue

    ln+Yi * / Xi ui

    for small X, 9Y Y

    X

    3ow // YY * percentage change in Y, so a change in

    X by one unit (X* ")is associated with a " "%change in Y(Y increases by a factor of "+ ").

    Note' 5hat are the units of uiand the >EL

    ofractional +proportional deviations

    ofor example, SER* .# means"

    6-#)

  • 8/14/2019 Introduction to Econometrics- Stock & Watson -Ch 6 Slides.doc

    25/59

    III. &oglog population regression function

    ln+Yi * / ln+Xi ui +b

    3ow changeX' ln+Y Y * / ln+X X +a

    >ubtract' ln+Y Y ! ln+Y * Iln+X X ! ln+XJ

    soY

    Y

    X

    X

    or 9

    9

    Y Y

    X X

    +small X

    6-#4

  • 8/14/2019 Introduction to Econometrics- Stock & Watson -Ch 6 Slides.doc

    26/59

    *og+log case, continue

    ln+Yi * / ln+Xi ui

    for small X,

    9

    9

    Y Y

    X X

    3ow //

    Y

    Y

    * percentage change in Y, and //

    X

    X

    *

    percentage change inX, so a 1% change in X is

    associated with a 1% change in Y.

    In the log-log specification 1has the interpretationof an elasticity.

    6-#6

  • 8/14/2019 Introduction to Econometrics- Stock & Watson -Ch 6 Slides.doc

    27/59

    Example- ln0 TestScore1 .s/ ln0 Income1

    Kirst defining a new dependent variable, ln+TestScore,andthe new regressor, ln+Income

    The model is now a linear regression of ln+TestScoreagainst ln+Income, which can be estimated by =8>'

    ln+ TestScore * 6.%%6 /./44)ln+Incomei +/.//6 +/.//#

    (n C increase inIncomeis associated with an

    increase of ./44)C in TestScore+factor of ./44)

    How does this compare to the log-linear model

    6-#:

  • 8/14/2019 Introduction to Econometrics- Stock & Watson -Ch 6 Slides.doc

    28/59

    Neither specification seems to fit as )ell as the cu$ic or linear+log6-#?

  • 8/14/2019 Introduction to Econometrics- Stock & Watson -Ch 6 Slides.doc

    29/59

    Summar$% &ogarithmic transformations

    Three cases, differing in whether Yand9orXistransformed by taking logarithms.

    (fter creating the new variable+s ln+Y and9or ln+X,the regression is linear in the new variables and the

    coefficients can be estimated by =8>.

    Hypothesis tests and confidence intervals are nowstandard.

    The interpretation of differs from case to case. Ahoice of specification should be guided by ;udgment

    +which interpretation makes the most sense in your

    application, tests, and plotting predicted values6-#B

  • 8/14/2019 Introduction to Econometrics- Stock & Watson -Ch 6 Slides.doc

    30/59

    Interactions +et,een Independent Variales

    (SW Section 6.-)

    erhaps a class siGe reduction is more effective in somecircumstances than in others"

    erhaps smaller classes help more if there are many

    English learners, who need individual attention

    That is,TestScore

    STR

    might depend onPctE*

    More generally,

    Y

    X

    might depend onX#

    How to model such 1interactions2 betweenXandX#

    5e first consider binaryXs, then continuousXs

    6-%/

  • 8/14/2019 Introduction to Econometrics- Stock & Watson -Ch 6 Slides.doc

    31/59

    (a) Interactions et,een t,o inar$ ariales

    Yi* / 2i #2#i ui

    2i,2#iare binary

    is the effect of changing2*/ to2*. &n this

    specification, this effect oesn(t epen on the .alue of

    2#.

    To allow the effect of changing2to depend on2#,

    include the 1interaction term22i2#ias a regressor'

    Yi* / 2i #2#i %+2i2#i ui

    6-%

  • 8/14/2019 Introduction to Econometrics- Stock & Watson -Ch 6 Slides.doc

    32/59

    Interpreting the coefficients

    Yi* / 2i #2#i %+2i2#i ui

    Neneral rule' compare the various cases

    E+Yi2i*/,2#i*# * / ## +b

    E+Yi2i*,2#i*# * / ## %# +a

    subtract +a ! +b'

    E+Yi2i*,2#i*# !E+Yi2i*/,2#i*# * %#

    The effect of2depends on #+what we wanted

    %* increment to the effect of2, when2#*

    6-%#

  • 8/14/2019 Introduction to Econometrics- Stock & Watson -Ch 6 Slides.doc

    33/59

    Example' TestScore, STR, English learners

    8et

    %iSTR*

    if #/

    / if #/

    STR

    STR

  • 8/14/2019 Introduction to Econometrics- Stock & Watson -Ch 6 Slides.doc

    34/59

    () Interactions et,een continuous and inar$

    ariales

    Yi* / 2i #Xi ui

    2iis binary,Xis continuous

    (s specified above, the effect on YofX+holding

    constant2 *#, which does not depend on2

    To allow the effect ofX to depend on2, include the

    1interaction term22iXias a regressor'

    Yi* / 2i #Xi %+2iXi ui

    6-%)

    h ff

  • 8/14/2019 Introduction to Econometrics- Stock & Watson -Ch 6 Slides.doc

    35/59

    Interpreting the coefficients

    Yi* / 2i #Xi %+2iXi ui

    Neneral rule' compare the various cases

    Y * / 2 #X %+2X +b

    3ow changeX'

    Y Y* / 2 #+XX %I2+XXJ +asubtract +a ! +b'

    Y* #X %2X orY

    X

    * # %2

    The effect ofXdepends on2+what we wanted

    %* increment to the effect ofX, when2*

    Example' TestScore, STR, %iE*+* ifPctE*#/6-%4

  • 8/14/2019 Introduction to Econometrics- Stock & Watson -Ch 6 Slides.doc

    36/59

  • 8/14/2019 Introduction to Econometrics- Stock & Watson -Ch 6 Slides.doc

    37/59

    TestScore* 6?#.# ! /.B:STR 4.6%iE*! .#?+STR%iE* +.B +/.4B +B.4 +/.B:

    Testing various hypotheses' The two regression lines have the same slope the

    coefficient on STR%iE*is Gero'

    t* !.#?9/.B: * !.%#cant re;ect

    The two regression lines have the same intercept thecoefficient on%iE*is Gero'

    t* !4.69B.4 * /.#B cant re;ect

    Example, ct/

    TestScore* 6?#.# ! /.B:STR 4.6%iE*! .#?+STR%iE*, +.B +/.4B +B.4 +/.B:

    6-%:

  • 8/14/2019 Introduction to Econometrics- Stock & Watson -Ch 6 Slides.doc

    38/59

    !ointhypothesis that the two regression lines are the

    same population coefficient on%iE** / and

    population coefficient on STR%iE** /'

    F* ?B.B) +p-value O .// //

    5hy do we re;ect the ;oint hypothesis but neither

    individual hypothesis

    Aonse7uence of high but imperfect multicollinearity'

    high correlation between%iE*and STR%iE*

    3inar'+continuous interactions- the t)o regression lines

    Yi* / 2i #Xi %+2iXi ui

    6-%?

  • 8/14/2019 Introduction to Econometrics- Stock & Watson -Ch 6 Slides.doc

    39/59

  • 8/14/2019 Introduction to Econometrics- Stock & Watson -Ch 6 Slides.doc

    40/59

    6-)/

    ( ) I t ti t t ti i l

  • 8/14/2019 Introduction to Econometrics- Stock & Watson -Ch 6 Slides.doc

    41/59

    (c) Interactions et,een t,o continuous ariales

    Yi* / Xi #X#i ui

    X,X#are continuous

    (s specified, the effect ofXdoesnt depend onX#

    (s specified, the effect ofX#doesnt depend onX To allow the effect ofXto depend onX#, include the

    1interaction term2XiX#ias a regressor'

    Yi* / Xi #X#i %+XiX#i ui

    6-)

    " ffi i t i ti ti i t ti

  • 8/14/2019 Introduction to Econometrics- Stock & Watson -Ch 6 Slides.doc

    42/59

    "oefficients in continuous+continuous interactions

    Yi* / Xi #X#i %+XiX#i ui

    Neneral rule' compare the various cases

    Y* / X #X# %+XX# +b

    3ow changeX'

    Y Y* / +XX #X# %I+XXX#J +a

    subtract +a ! +b'

    Y* X %X#X or

    Y

    X

    * # %X#

    The effect ofXdepends onX#+what we wanted %* increment to the effect ofXfrom a unit change

    inX#

    Example' TestScore, STR, PctE*6-)#

  • 8/14/2019 Introduction to Econometrics- Stock & Watson -Ch 6 Slides.doc

    43/59

    TestScore* 6?6.% ! .#STR! /.6:PctE* .//#+STRPctE*, +.? +/.4B +/.%: +/./B

    The estimated effect of class siGe reduction is nonlinear

    because the siGe of the effect itself depends onPctE*'

    TestScore

    STR

    * !.# .//#PctE*

    PctE* TestScore

    STR

    / !.#

    #/C !.#.//##/ * !./Example, ct- h'pothesis tests

    TestScore* 6?6.% ! .#STR! /.6:PctE* .//#+STRPctE*, +.? +/.4B +/.%: +/./B

    6-)%

  • 8/14/2019 Introduction to Econometrics- Stock & Watson -Ch 6 Slides.doc

    44/59

    Foes population coefficient on STRPctE** /

    t* .//#9./B * ./6 cant re;ect null at 4C level

    Foes population coefficient on STR* /

    t* !.#9/.4B * !.B/ cant re;ect null at 4C level

    Fo the coefficients on bothSTRandSTRPctE** /

    F* %.?B +p-value * ./# re;ect null at 4C level+

  • 8/14/2019 Introduction to Econometrics- Stock & Watson -Ch 6 Slides.doc

    45/59

    Application% Nonlinear 0ffects on 1est Scores

    of the Student1eacher Ratio

    (SW Section 6.2)

    Kocus on two 7uestions'

    . (re there nonlinear effects of class siGe reduction ontest scores +Foes a reduction from %4 to %/ have

    same effect as a reduction from #/ to 4

    #. (re there nonlinear interactions betweenPctE*and

    STR +(re small classes more effective when there are

    many English learners

    6-)4

  • 8/14/2019 Introduction to Econometrics- Stock & Watson -Ch 6 Slides.doc

    46/59

    5hat is a good 1base2 specification

  • 8/14/2019 Introduction to Econometrics- Stock & Watson -Ch 6 Slides.doc

    47/59

    5hat is a good base specification

    6-):

    The TestScore Income relation

  • 8/14/2019 Introduction to Econometrics- Stock & Watson -Ch 6 Slides.doc

    48/59

    The TestScore!Incomerelation

    (n advantage of the logarithmic specification is that it is

    better behaved near the ends of the sample, especially large

    values of income.6-)?

    +ase specification

  • 8/14/2019 Introduction to Econometrics- Stock & Watson -Ch 6 Slides.doc

    49/59

    +ase specification

    Krom the scatterplots and preceding analysis, here are

    plausible starting points for the demographic control

    variables'

    Fependent variable' TestScore

    Independent ariale Functional form

    PctE* linear*unchP"T linear

    Income ln+Income+or could use cubic

    6-)B

    4uestion 5'

  • 8/14/2019 Introduction to Econometrics- Stock & Watson -Ch 6 Slides.doc

    50/59

    4uestion 5'&nvestigate by considering a polynomial in STR

    TestScore* #4#./ 6).%%STR! %.)#STR#

    ./4BSTR%

    +6%.6 +#).?6 +.#4 +./#

    ! 4.):%iE*! .)#/*unchP"T .:4ln+Income +./% +./#B +.:?

    &nterpretation of coefficients on'

    %iE**unchP"T ln+Income STR, STR#, STR%

    6-4/

    Interpreting the regression function ia plots

  • 8/14/2019 Introduction to Econometrics- Stock & Watson -Ch 6 Slides.doc

    51/59

    Interpreting the regression function ia plots

    +preceding regression is labeled +4 in this figure

    6-4

    Are the higher order terms in "#$ statisticall$

  • 8/14/2019 Introduction to Econometrics- Stock & Watson -Ch 6 Slides.doc

    52/59

    Are the higher order terms in"#$statisticall$

    significant3

    TestScore* #4#./ 6).%%STR! %.)#STR# ./4BSTR%+6%.6 +#).?6 +.#4 +./#

    ! 4.):%iE*! .)#/*unchP"T .:4ln+Income

    +./% +./#B +.:?

    +a%/' 7uadratic in STRv.%' cubic in STR

    t* ./4B9./# * #.?6 +p* .//4

    +b%/' linear in STRv.%' nonlinear9up to cubic in STRF* 6.: +p* .//#

    6-4#

    4uestion 5#' STR-PctE* interactions

  • 8/14/2019 Introduction to Econometrics- Stock & Watson -Ch 6 Slides.doc

    53/59

    4uestion 5#' STR-PctE* interactions

    +to simplify things, ignore STR#, STR%terms for now

    TestScore* 64%.6 ! .4%STR 4.4/%iE*! .4?%iE*STR +B.B +.%) +B.?/ +.4/

    ! .)*unchP"T #.#ln+Income +./#B +.?/

    &nterpretation of coefficients on'

    STR%iE* +wrong sign%iE*STR*unchP"T ln+Income

    6-4%

    Interpreting the regression functions .ia plots'

  • 8/14/2019 Introduction to Econometrics- Stock & Watson -Ch 6 Slides.doc

    54/59

    Interpreting the regression functions .ia plots'

    TestScore* 64%.6 ! .4%STR 4.4/%iE*! .4?%iE*STR

    +B.B +.%) +B.?/ +.4/! .)*unchP"T #.#ln+Income +./#B +.?/

    4Real,orld5 (4polic$5 or 4economic5) importance ofthe interaction term%

    TestScore

    STR

    * !.4% ! .4?%iE**

    .# if

    .4% if /

    %iE*

    %iE*

    = =

    The difference in the estimated effect of reducing theSTRis substantial0 class siGe reduction is more

    effective in districts with more English learners

    6-4)

    Is the interaction effect statisticall$ significant3

  • 8/14/2019 Introduction to Econometrics- Stock & Watson -Ch 6 Slides.doc

    55/59

    Is the interaction effect statisticall$ significant3

    TestScore* 64%.6 ! .4%STR 4.4/%iE*! .4?%iE*STR

    +B.B +.%) +B.?/ +.4/

    ! .)*unchP"T #.#ln+Income +./#B +.?/

    +a%/' coeff. on interaction*/ v.%' nonGero interaction

    t* !.: not significant at the /C level

    +b%/' both coeffs involving STR* / vs.

    %' at least one coefficient is nonGero +STRentersF* 4.B# +p* .//%

    Next- specifications )ith pol'nomials interactions