Date post: | 13-Apr-2018 |
Category: |
Documents |
Upload: | zaheer-khan |
View: | 230 times |
Download: | 0 times |
of 21
7/26/2019 Spec Tests
1/21
Econometrics I1
Specication tests
Marianna Belloc
Sapienza University of Romehttp://w3.uniroma1.it/belloc/
November-December, 2009PhD Economics, University of Siena
1These slides strongly rely on (and some parts are taken directly from):W1: J. Wooldridge: Introductory Econometrics: A Modern Approach, South-Western
W2: J. Wooldridge: Econometric Analysis of Cross Section and PanelData, MITPressBelloc (Sapienza) Lecture VII Nov-De c, 2009 1 / 21
http://find/7/26/2019 Spec Tests
2/21
Testing for endogeneity
Call y1 the dependent variable of ther structural model, y2 theendogenous independent variable, and z1 the exogenous regressors in
the structural model,
y1 =z11+1y2+u1
where z1 (l1 1). Assume we have a subset of instruments z, which
is a l 1 vector, such thatE(zu1) =0
Identication requires that at least one instrument in z is excluded inz1 (order condition), and at least one instrument in z which is
excluded in z1 is partially correlated with y2 (rank condition)The Hausman test for endogeneity consists in comparing ols and 2slsestimators for 1 (1, 1): ify2 is uncorrelated with u1, then thetwo estimators should dier only by the sampling error. We will
consider the regression based form of the testBelloc (Sapienza) Lecture VII Nov-De c, 2009 2 / 21
http://find/7/26/2019 Spec Tests
3/21
Testing for endogeneity: Hausman test I
Consider the linear projection ofy2 on z
y2 =z2+v2 where E(z0v2) =0
Since zis uncorrelated with u1, it follows that y2 is endogenous (thatis E(u1y2)6=0) if and only ifE(u1v2)6=0
We then want to test ifE(u1v2)6=0, and run
u1 =1v2+e1
where 1 =E(u1v2)/E(v22), E(e1v2) =0 and E(z
0e1) =0(since
E(z0
u1) =0and E(z0
v2) =0)Substitute u1 =1v2+e1 in y1 =z11+1y2+u1 and obtain
y1 =z11+1y2+1v2+e1
Belloc (Sapienza) Lecture VII Nov-De c, 2009 3 / 21
http://find/7/26/2019 Spec Tests
4/21
Testing for endogeneity: Hausman test IIThe Hausman test consists in testing
H0 :1 =0
since v2 is not observable it can be obtained by the ols residuals ofthe rst stage, v2, so that we can consistently estimate regression
y1 =z11+1y2+1v2+e1
by ols and then compute tstatistic (the classical one or theheteroskedasticity robust if heresoskedasticity is suspected) for 1 inorder to the H0 :1 =0 (Nota bene: ols estimates from aboveequation are identical to estimates from the 2sls procedure)
When there is only one suspected endogenous regressor, we can use
directly a statistic that only compares ols and 2sls estimates of theparameter of interest, that is in our case
1,2sls 1,ols[se(1,2sls)2 se(1,ols)2]1/2
which is the Hausman t statisticBelloc (Sapienza) Lecture VII Nov-De c, 2009 4 / 21
http://find/7/26/2019 Spec Tests
5/21
Testing for endogeneity: application I
To implement the Hausman procedure
I
reg educ exper exper2 motheduc fatheduc huseducI predict res, residualI reg ly educ exper exper2 res
The null that educ is exogenous can be rejected at the 10% level, sowe are induced to use 2sls rather than ols
Belloc (Sapienza) Lecture VII Nov-De c, 2009 5 / 21
http://find/7/26/2019 Spec Tests
6/21
Testing for endogeneity: application II
Type
I ivreg ly exper exper2 (educ=motheduc fatheduc huseduc)I est store 2slsI reg ly educ exper exper2I hausman 2sls
where 0.027/0.0165= 1.65 which induces to reject the null at the10% level
Belloc (Sapienza) Lecture VII Nov-De c, 2009 6 / 21
http://find/7/26/2019 Spec Tests
7/21
Testing for endogeneity: Hausman test III
Extensions to the multiple (lets say g1) endogenous regressors case isstraightforward
y1 =z11+y21+u1 with E(z0u1) =0
where 1 is g1 1, where y2 = (y12 , y22 ...yg12)
Reduced form for y2 isy2 =z2+v2
where v2 is g1 1, and v2 can be obtained from the ols residuals ofeach of the g1 rst stages (one for each endogenous regressor yh2 onz)
Estimatey1 =z11+y21+ v21+e
Run F test for H0 :1 =0 (test for multiple g1 restrictions), wherethe restricted model is that obtained setting 1 =0
Belloc (Sapienza) Lecture VII Nov-De c, 2009 7 / 21
http://find/7/26/2019 Spec Tests
8/21
Testing for endogeneity: Hausman test IV
An alternative, as usual, is the LM test:
I Run ols regression y1 on z1 and y2,and obtain u1I Run ols regression ofy2 on z, and obtain v2I Run ols regression u1 on z1, y2 and v2, and obtain R
2u
I Compute nR2ua2g1
Belloc (Sapienza) Lecture VII Nov-De c, 2009 8 / 21
http://find/7/26/2019 Spec Tests
9/21
Testing for endogeneity: application III
We want to estimate
log(wage) = 1+2exper+3exper2 +4educ+5black educ+ u
where we suspect educto be endogenous and consequently also theinteraction term educ blackto be endogenous
Suppose we exploit Card (1995)s idea to use nearc4 as an instrumentforeduc(which is a dummy variable if the individual grew up in theproximity of a four year college), and so nearc4 blackas aninstrument for educ black
We have
I use D:nLezioninDottoratonEconometrics_SienanstatanCARD.DTAI gen exper2=exper*experI gen educbl=educ*blackI gen nearc4bl=nearc4*blackI ivreg lwage exper exper2 (educ educbl=nearc4 nearc4bl)
Belloc (Sapienza) Lecture VII Nov-De c, 2009 9 / 21
http://find/7/26/2019 Spec Tests
10/21
Testing for endogeneity: application IV
Nota bene: R2 is missing because it is negative (indeed the explained sumof squares is negative) and stata suppresses it. Seehttp://www.stata.com/support/faqs/stat/2sls.html
Belloc (Sapienza) Lecture VII N ov-D ec, 2009 10 / 21
http://find/7/26/2019 Spec Tests
11/21
Testing for endogeneity: application V
For HausmanI reg educ exper exper2 nearc4 nearc4blI predict res1, residualI reg educbl exper exper2 nearc4 nearc4blI predict res2, residualI
reg lwage educ educbl exper exper2 res1 res2I test res1 res2
which induces us to reject the null of exogeneity ofeduc and educbl
Belloc (Sapienza) Lecture VII N ov-D ec, 2009 11 / 21
http://find/7/26/2019 Spec Tests
12/21
Testing for endogeneity: application VI
For LM
I reg lwage exper exper2 educ educblI predict res, residualI reg educ exper exper2 nearc4 nearc4blI predict res1, residualI reg educbl exper exper2 nearc4 nearc4blI predict res2, residualI reg res exper exper2 educ educbl res1 res2I gen LM=0.0131 3010I
pval=chi2tail(2,39.43)
Belloc (Sapienza) Lecture VII N ov-D ec, 2009 12 / 21
http://find/7/26/2019 Spec Tests
13/21
Testing for endogeneity: application VI
compute: n R2 =0.0131 3010= 39.431, p-value is 0.0000. Thisinduces us again to reject the null of exogeneity ofeduc and educbl
Belloc (Sapienza) Lecture VII N ov-D ec, 2009 13 / 21
http://find/7/26/2019 Spec Tests
14/21
Testing for overidentifying restrictions I
If we have more instruments than required for exact identication, wecan test if they are exogenous, i.e. ifE(z, u1) =0
Considery1 =z11+y21+u1
and take the partition ofz= (z1, z2) where z2 is a 1 l2 vectorcontaining the excluded instruments
Hausmans general idea is to compare 2sls estimates with olsestimate, if all the instrument are valid they should dier only as a
result of the sampling error
Belloc (Sapienza) Lecture VII N ov-D ec, 2009 14 / 21
http://find/7/26/2019 Spec Tests
15/21
Testing for overidentifying restrictions II
We can implement the following procedureI Run 2sls regression y1 on z1 and y2,using zas instruments, and obtain
u1I Run ols regression ofu1 on z, and obtain R
2u
I Compute nR2uI Under H0 :E(z, u1 ) =0, nR2u a2q1 where q1 l2 g1 (i.e. number
of overidentifying restrictions)I (as always we can obtain the heteroskedasticity robust version)
IfH0 :E(z, u1) =0 is rejected, then some instrument is not valid
If, by contrast, H0 :E(z, u1) =0 is not rejected, then we can havesome condence that in the overall set of instruments
Belloc (Sapienza) Lecture VII N ov-D ec, 2009 15 / 21
http://find/http://goback/7/26/2019 Spec Tests
16/21
Testing for overidentifying restrictions - application IType
I use D:nLezioninDottoratonEconometrics_Sienanstatanmroz.dta, gen
ly=log(wage), gen exper2=exper*experI ivreg ly exper exper2 (educ=motheduc fatheduc huseduc)I predict res, residualI reg res exper exper2 motheduc fatheduc huseducI gen pval=chi2tail(2, 1.11)
the test statistic is 0.026 428= 1.11 and the p-value is 0.574 so the
null hypothesis is not rejectedBelloc (Sapienza) Lecture VII N ov-D ec, 2009 16 / 21
http://find/7/26/2019 Spec Tests
17/21
Testing for functional forms
Sometimes we may suspect that we are neglecting some nonlinearities
in the model estimated either by ols or by 2slsIn the case of all exogenous regressors we can just include nonlinearfunctions (squares or cross-products) of our regressions in theequation and then implement F orLM statistics
In the presence of suspected endogeneity we need instruments for allthe nonlinear functions we are chooseing of our (potentially)endogenous regressions. We might use as instruments thecorresponding nonlinear functions of all the instrument we are usingfor our (potentially) endogenous regressors, but that would consume
many degrees of freedomRamseys RESET test is conserving on the number of degrees offreedom (which is kregardless the number of nonlinear functions wewant to control for)
Belloc (Sapienza) Lecture VII N ov-D ec, 2009 17 / 21
f f f S
http://find/7/26/2019 Spec Tests
18/21
Testing for functional forms: Ramseys RESET test I
Consider
y=x +uwith E(ujx) =0
Condition E(ujx) =0 implies that u is uncorrelated with anyregressor in x and with any function ofx
Dene yi= xi, the tted values from the ols regression, and ui the
ols residuals. By denition of ols, cov(ui, yi) =0
But we may want to test ifui is correlated with any low-orderpolynomial ofyi : y
2i , y
3i , y
4i
There are two ways to test that
I Estimate by ols: yi = 1+2xi2...kxik+2y2i +3y3i +4y4i +ui,and compute standard F test for H0 :2 =3 =4 =0
I Regress ui on xi, y2i , y
3i ,y
4i , compute LM=nR
2u
a23
Belloc (Sapienza) Lecture VII N ov-D ec, 2009 18 / 21
T i f f i l f R RESET II
http://find/7/26/2019 Spec Tests
19/21
Testing for functional forms: Ramseys RESET test II
Nota bene: It is sometimes maintained that the RESET test can be
used as a test for any specication problem, such as heteroskedasticityor omitted variables. However it is a poor test for such problems
Belloc (Sapienza) Lecture VII N ov-D ec, 2009 19 / 21
T i f f i l f li i I
http://find/7/26/2019 Spec Tests
20/21
Testing for functional forms: application I
use D:nLezioninDottoratonEconometrics_Sienanstatanmroz.dta, genly=log(wage), gen exper2=exper*exper
reg ly exper exper2 educ
predict tted
predict res, residualgen tt2=tted*tted, gen tt3=tted*tted*tted, gentt4=tt2*tt2
reg res exper exper2 educ tt2 tt3 tt4
gen LM=0.0078*428gen pval=chi2tail(3,3.3384)
Belloc (Sapienza) Lecture VII N ov-D ec, 2009 20 / 21
T ti f f ti l f li ti II
http://find/7/26/2019 Spec Tests
21/21
Testing for functional forms: application II
LM=0.0078 428=3.3384, the corresponding p-value with 3 degrees offreedom is 0.3423 therefore we are not led to reject the null hypothesis
Belloc (Sapienza) Lecture VII N ov-D ec, 2009 21 / 21
http://goforward/http://find/http://goback/