e views session 2

Upload: babutu123

Post on 02-Jun-2018

219 views

Category:

Documents


0 download

TRANSCRIPT

  • 8/10/2019 e Views Session 2

    1/18

    Principles of Econometrics class of October 14th FEUNLNotes by Jos Mrio Lopes1

    1 !eteros"e#asticity in a cross$section frame%or" &e'amples from chapter ()

    Heteroskedasticity happens whenever Var(ui|x1,x2,) is not constant for allobservations

    !ast class, you"ve seen how to robustify your standard errors when you suspect to be in

    the presence of heteroskedasticity #n the $ultiple re%ression $odel,

    uxxxy kk +++++= 2211&

    'ou would have to co$pute

    2

    1

    2

    2(

    ((

    x

    n

    i i

    ij

    jSST

    r

    Var ==

    here ri*denotes the ithresidual fro$ re%ressin% x*on all other independent variables

    (see section +2)

    #n Views, this can be done by choosin% on the -.ptions/ 0enu, the hite standard

    errors

    1#f you find any typo in these notes, please e$ail $e so # can correct it

    1

  • 8/10/2019 e Views Session 2

    2/18

    obust standard errors and t statistics are appropriate as the sa$ple si3es increases e

    don"t always use these robust standard errors because, in s$all sa$ples, the robust t

    statistics can depart a lot fro$ the t distribution

    Hence, it isi$portant to know whether there is or there isn"t heteroskedasticity in our

    sa$ple !et"s perfor$ a few exa$ples pickin% exa$ples fro$ the book 4ake theexa$ple on the de$and for ci%arettes, fro$ chapter + Open the corresponding workfile

    e wish to esti$ate the de$and for ci%arettes $easured by the nu$ber of ci%arettes

    s$oked per day as a function of inco$e, the price of a pack of ci%arettes, education,

    a%e, s5uared a%e and the presence of a ban on restaurants fro$ the state the person

    surveyed lives

    e %et the followin% results6

    2

  • 8/10/2019 e Views Session 2

    3/18

    neither inco$e nor ci%arette price is si%nificant and their i$pacts would be s$allanyway (e%, if inco$e increases by 1&7, ci%s increases by (&++&81&&)91&:&&++

    ci%arettes per day);

    education reduces s$okin%;

    s$okin% increases with a%e up until approx fter that, it falls

    *+t no%, a -ery important .+estion/ is there heteros"e#asticity0 f so, the +s+al

    stan#ar# errors an# t statistics %ill be %ron2 an# OL3 %ill not be efficient e %ill

    perform 5+st a co+ple tests to chec" for heteros"e#asticity 3ee other tests a-ailable

    on E6ie%s

    First, let7s r+n the *re+sch$Pa2an test for heteros"e#asticity6

    1) sti$ate the $odel by .!?, keep the s5uared .!? esti$ated residuals

    2) un an auxiliary re%ression of the s5uared .!? esti$ated residuals on the

    independent variables @eep the s5uared fro$ this re%ression

    =) Aor$ either the A (followin% a A(k,nk1)) or the !0 (followin% a chis5uare with k

    de%rees of freedo$) #f the pvalue is %reater than B7, we do not re*ect the null

    of ho$oskedasticity

    #n Views, this is very easy to do

    =

  • 8/10/2019 e Views Session 2

    4/18

    Cehold how $any options you have for runnin% a heteroskedasticity testD

  • 8/10/2019 e Views Session 2

    5/18

    Aor a CE test, we %et

    Coth the A test and the !0 (obs9s5uared of the auxiliary re%ression) conclude for the

    re*ection of the null of ho$oskedasticity

    'ou should check that Views is doin% this ri%ht HowF Generate the residuals yourself

    and perfor$ the re%ression as usual (ew .b*ect85uation, etc) 'ou will %et the sa$eoutput as above

    hite test for heteros"e#asticitytakes into account the possibility that the variance

    structure $i%ht be richer 4he s5uares and crossproducts of the independent variables

    are also included in the ri%hthand side >lternatively, whenever you have too $any

    independent variables, you can use the fitted values of the dependent variable and the

    s5uared fitted values of the independent variable

    B

  • 8/10/2019 e Views Session 2

    6/18

    #n our case, you %etHeteroskedasticity Test: White

    F-statistic 2.159258 Prob. F(25,781) .9

    !bs"#-s$%ared 52.172&5 Prob. 'hi-$%are(25) .11

    caed e*+aied 11.81 Prob. 'hi-$%are(25) .

    4his $eans that the null of ho$oskedasticity is re*ectedAro$ this point, we can correct the standard errors usin% the hite robust standard

    errors

    .r, we can transfor$ the $odel and run .!? on this transfor$ed $odel HowF

    Feasible 8enerali9e# Least 3.+aresprocedure6

    %enerate the esti$ated s5uared residuals (the residuals fro$ the $odeluxxy kko ++++= 11 ;

    re%ress the lo% of the esti$ated s5uared residuals on the independent variables (why

    the lo%F), obtain the fitted values of this re%ression(

    g

    exponentiate the fitted values to %et )exp(

    gh =

    esti$ate the e5uation uxxy kko ++++= 11 by L3, usin%(

    81 has wei%hts

    ?ince we have to esti$ate h, AG!? will not be unbiased but it is consistent and

    asy$ptotically $ore efficient than .!?

    #f ci%sIresids5 stands for the esti$ated h, we have to divide the $odel by

    J

  • 8/10/2019 e Views Session 2

    7/18

    18s5uare root(h) hyF ?ee book (there is a univariate exa$ple there for savin%s, start

    fro$ there)

    e will %et

    e+edet /ariabe: '03#('04#03F)

    6ethod: east $%aresate: 1129 Tie: 17:

    a+e: 1 87

    0c%ded obseratios: 87

    'oe;;iciet td. rror t-tatistic Prob.

    13#('04#03F) 5.5&71 17.81& .15&& .7517

    !(0?23#('04#03F) -.527 .99 -5.9897 .#T>=#

  • 8/10/2019 e Views Session 2

    8/18

  • 8/10/2019 e Views Session 2

    9/18

    'ou can actually see several %raphs at the sa$e ti$e if you select a 8ro+pof variables

    L

  • 8/10/2019 e Views Session 2

    10/18

    !et"s esti$ate a si$ple $odel, now

    1&

  • 8/10/2019 e Views Session 2

    11/18

    =he lo2 of the price seems to be si2nificant >o+ may thin" this is O?, b+t it is not

    *oth -ariables are tren#in2 thro+2ho+t the sample

    f yo+ ta"e a loo" at the resi#+als, yo+ can see if %hat yo+7re #oin2 ma"es sense or

    not

    4hey are not stationary (there are for$al tests to see this, na$ely unit root tests like the

    Dickey-Fuller or Phillips-Perrontests and you can always look at the correlo%ra$ of

    the residuals) 4his $eans we should rethink your specification .ur previous re%ression

    wassp+rio+s

    e no% a## a linear tren# to ta"e acco+nt of the tren#in2 beha-io+r of LN6P@

    11

  • 8/10/2019 e Views Session 2

    12/18

    !E#M does not co$e si%nificant any$ore e conclude that there are other factors

    beyond the price that are captured by the linear trend that see$ to be i$portant2

    Notice that these other factors are not mo#elle# 5+st by a##in2 a linear tren#

    Moreo-er, the fact that a linear tren# appears to be informati-e sho+l#n7t promptyo+ to 2et carrie# a%ay an# start obsessi-ely a##in2 a h+2e train of tren# terms

    &linear, .+a#ratic,A)

    hat we just did !adding a linear trend" has a detrending interpretation# it is

    e$ui%alent to regressing all %aria&les o%er a constant and a linear trend' sa%ing the

    residuals and regressing the residuals of the dependent %aria&le regression o%er the

    residuals of the independent %aria&les regressions !see &ook"(

    :: mportant ass+mptions an# problems in a =ime 3eries frame%or"/

    =he 8a+ss$Mar"o- theorem re.+ires both homos"e#asticity an# absence of

    serially correlate# errors Other%ise, the OL3 estimator %ill not be *LUE an# the

    +s+al stan#ar# errors an# t$statistics %ill no lon2er be -ali#

    !o% #o %e test for the presence of serial correlation0

    !et"s see a few possibilities available in Views

    'ou can take a look at the Nurbinatson statistic, that appears at the botto$ of the

    results

    e+edet /ariabe: 0d@%sted #-s$%ared .959 .. de+edet ar .1725&

    .. o; reAressio .1&&1 >kaike i;o criterio -.97&252

    % s$%ared resid .8&75 chBarC criterio -.851

    oA ikeihood 2.&59 F-statistic 1.797

    Durbin-Watson stat 1.048727 Prob(F-statistic) .29

    4he B+rbin$atson test, valid under classical assu$ptions, is based on the .!?

    residuals and one can show that N is approxi$ately 2(1) where is the firstorder

    2'ou should always test the residuals to see if they"re wellbehaved #n this case, they are stillnonstationary #n a practical work, you should keep on lookin% for a correct specification

    12

  • 8/10/2019 e Views Session 2

    13/18

    correlation coefficient between residuals at tand residuals at t-) #f the Nurbinatson

    statistic is near 2, the correlation coefficient will be near & Hence, we are lookin% for a

    value si%nificantly below 2 (for a positive correlation coefficient) and si%nificantly

    above 2 (for a ne%ative correlation coefficient) #$a%ine you were testin% if was close

    to 3ero (N close to 2) a%ainst an alternative hypothesis that was bi%%er than 3ero

    (N s$aller than 2) 4here are two critical values, d!and dO, tabled by ?avin and hite(1LKK), dependin% on the nu$ber of observations and the nu$ber of re%ressors 4his

    $eans that, if N falls between d!and dO, the results are inconclusive

    >fter you esti$ate your $odel, you have a ?erial correlation $enu under esidual

    4ests

    1=

  • 8/10/2019 e Views Session 2

    14/18

    4his is the *re+sch$8o#frey test 4he ull is of absence of autocorrelation Here, we

    re*ect this ull6 there is evidence to say there is autocorrelation e basically are

    keepin% the residuals of the re%ression, and re%ressin% u tover ut1, ut2, and the

    re%ressors #f the A statistic re*ects this $odel, we conclude that there is no

    autocorrelation=

    .nce you find out that here is firstorder serial correlation, you can transfor$ the $odel

    to take this into account61 P esti$ate the ori%inal $odel and take the esti$ated residuals

    2 P run the re%ression of Qt over Qt1 to co$pute the correlation coefficient

    = P Aor everyvariable xt(and for the dependent variable), co$pute the 5uasi

    differenced variable xtxt1pply .!? to the e5uation with the 5uasidifferenced variables 4he usual standard

    errors, t statistics and A are asy$ptotically valid