1、第第10章序列相关性章序列相关性Serial Correlation/AutocorrelationMain ContentslWhat is Serial correlation(Autocorrelation)?lThe consequences of serial correlationlHow to detect the serial correlation?lCorrections for serial correlationWhat is Serial correlation(Autocorrelation)?lThe assumption that errors correspo
2、nding to different observations are uncorrelated often breaks down in time-series studies.lWhen the error terms from different(usually adjacent)time periods are correlated,we say that the error term is serially correlated.That is,lCov(ui,uj)0,i.e.E(ui,uj)0 for i j.Patterns of serial correlationReaso
3、ns of serial correlationlInertia or sluggishnesslModel specification errors(omitted variables)What is Serial correlation(Autocorrelation)?lIn this chapter,we only deal with the problem of first-order serial correlation,in which errors in one time period are correlated directly with errors in the ens
4、uing period.For example,ut=r ut-1+vtlSecond-order serial correlation will be ut=r1ut-1+r2ut-2+vtThe consequences of serial correlation(Autocorrelation)lOLS estimators will be still unbiased and consistent.take the simple regression as an example Y=b0+b1 X+ulWe know the OLS estimator of b1 is 1122111
5、2iiiiiiiiiXX YXX uXXXXXX uEEXXbbbbb+The consequences of serial correlation(Autocorrelation)lThe R2 and adj-R2 are still consistent if the time series is stationary(thats r 1).Or else,for non-stationary time series,the R2 and adj-R2 may be invalid.The consequences of serial correlation(Autocorrelatio
6、n)lOLS estimators will not be efficient.The variance of OLS estimators will be biased.12111122222122222211var2cov,varvarvar2,where,var,cov,.If there exists first ornn tttttjttjtttttjtttnn tjjxxttjtttjxttjxux xu uxuXX uXXxxTSSTSSx xuu uTSSxbbrr+1212der serial correlation,ie.However,OLS estimate of th
7、e variance of is.So,in this case,OLS estimates of the variances of the partial coefficients are biased.tttiuuvXXrb+The consequences of serial correlation(Autocorrelation)lt-statistics and F-statistic will be misleading when there are serial correlation in error terms ut.lThe variance and standard er
8、ror of the predicted value will be invalid.How to detect the serial correlation?lTime-sequence plotlRuns testlDurbin-Watson testTime sequence plot-4-2024e_t19601970198019902000yearExample:Real wages and productivity(Example 10-1)-4-2024e_t-4-2024e_t-1Runs testlFirst,get the sign of the residuals,et,
9、for example,(-)(+)(-)(+)(-),that is,there are 9 negative signs,followed by 8 positive signs and so on.lThe same signs in the parentheses are called a run.lLet N is the number of observations,and N1 is the number of positive signs of the residuals,and N2 is the number of negative signs.And k is the n
10、umber of runs.Runs testlSwed and Eisenhart give us a table of critical values.lH0:the residual e is stochastic,that is,there is no serial correlation.lHow to test?If the number of run in your model is less than or equal the critical value n1(table A-6a),and larger than or equal to the critical value
11、 n2(A-6b),then we can reject the null hypothesis,H0,means there exists serial correlation.Runs test(example)lIf the signs of the residual is (-)(+)(-)(+)(-)9 8 4 2 3lThen,N1=8+2=10,N2=9+4+3=16,N=26,k=5,then the critical value at 5%significance is 8 and 19.So,if the runs in our model 8 or 19,we shoul
12、d reject the null hypothesis H0.lThe number of runs in our model is 58,so we reject the H0,which mean there is serial correlation in our model.Durbin-Watson TestlDurbin and Watson put forward an d statistic(DW).lIn most software,d-value will be provided with R2,adj-R2(Eviews),in STATA,using command
13、tsset year/*to describe the data is time series*/estat dwatson/*must using after reg*/dwstat/*the out of dated command*/21221ntttntteedeDurbin-Watson TestlThere must be a intercept term in the regression model;lIt only can be used to detect the first order serial correlation.That is,ut=r ut-1+vt,-1r
14、1.lThere is no lagged dependent variable as explanatory variable.Ct=b0+b1Yt+b2Ct-1+utDurbin-Watson TestlWe can rewrite the Durbin-Watson d-stat as1221 2 1where,=ntttnttdeeerrrd-value-140210Durbin-Watson TestlIf the Durbin-Watson d-stat lies in(du,4-du),there is no serial correlation.lIf d4-dL,there
15、are positive and negative serial correlation respectively.lIf dLddU,or 4-dUd4-dL,then we cant detect the serial correlation.0dLdU24-dU4-dL4Reject H0,Positive serial correlationAccept H0,there is no serial correlation.Reject H0,Negative serial correlationCan not identify.Can not identify.Durbin-Watso
16、n Test:ProcedurelFirst regress Y on Xs,and get the residuals et.lCalculate the DW d-stat.May be given by software.lGiven the number of observations n and the number of explanatory variables k,check the critical value dL and dU.lUsing the rule to judge whether there is serial correlation.Real wages a
17、nd productivity:DW testlTable 10_1.txtlinsheet using“table 10_1.txt”,clearltsset yearlreg rwage productldwstat or estat dwatsonld=0.2137 n=44 k=1ldL(44,1)=1.475 dU(44,1)=1.566ld Z0.05=1.645,reject H0.lStata command:estat durbinalt 10,1211andnhNn Varn VarrbbCorrections for serial correlation:Generali
18、zed differencinglYt=b0+b1Xt+ut (1)lIf there is first-order serial correlation,that is,ut is AR(1)process.i.e.ut=r ut-1+vt,-1r1.lThen the model for next period is Yt-1=b0+b1Xt-1+ut-1lMultiple both sides,rYt-1=rb0+rb1Xt-1+rut-1(2)l(1)-(2),Yt-rYt-1=(1-rb0+b1Xt rXt-1)+(ut-rut-1),rewrite aslYt*=b0*+b1Xt*
19、+vt,where vt is no serial correlation.Corrections for serial correlationlBut we dont know r,first we need to estimate it.There are several method to estimate r.l(1)If there are first-order serial correlation,i.e.ut=r ut-1+vt,-1r1.Then,we use model et=r et-1+vt to estimate r.l(2)estimate it from Durb
20、in-Watson d-stat 2 1dr12dr Example:real wage and productivitylFirst regress rwages on product,and get residuals elThen regress e on e_n-1 without constant,and get the estimate of r 0.8708lThen transform to the new modellrwagest-0.87rwagest-1=b0*+b1(productt-0.87productt-1)+vtlGet the estimation of t
21、he above equation,lrwagest-0.87rwagest-1=5.47+0.569(productt-0.87productt-1)Prais-Winsten transformationlUsually applied in small sample cases,take example 10.1 for instancelreplace r=sqrt(1-0.87082)*rwages in 1lreplace p=sqrt(1-0.87082)*product in 1 _ _c co on ns s 2 2.9 99 93 36 61 11 1 .9 92 21 1
22、1 11 13 32 2 3 3.2 25 5 0 0.0 00 02 2 1 1.1 13 34 47 72 29 9 4 4.8 85 52 24 49 93 3 p p .7 78 83 35 59 90 09 9 .0 07 70 03 31 19 99 9 1 11 1.1 14 4 0 0.0 00 00 0 .6 64 41 16 67 79 96 6 .9 92 25 55 50 02 22 2 r r C Co oe ef f.S St td d.E Er rr r.t t P P|t t|9 95 5%C Co on nf f.I In nt te er rv va al
23、l T To ot ta al l 4 43 32 2.9 95 56 67 76 69 9 4 43 3 1 10 0.0 06 68 87 76 62 21 1 R Ro oo ot t M MS SE E =1 1.6 61 14 41 1 A Ad dj j R R-s sq qu ua ar re ed d =0 0.7 74 41 12 2 R Re es si id du ua al l 1 10 09 9.4 43 30 01 16 62 2 4 42 2 2 2.6 60 05 54 48 80 00 04 4 R R-s sq qu ua ar re ed d =0 0.7
24、 74 47 72 2 M Mo od de el l 3 32 23 3.5 52 26 66 60 08 8 1 1 3 32 23 3.5 52 26 66 60 08 8 P Pr ro ob b F F =0 0.0 00 00 00 0 F F(1 1,4 42 2)=1 12 24 4.1 17 7 S So ou ur rc ce e S SS S d df f M MS S N Nu um mb be er r o of f o ob bs s =4 44 4.r re eg g r r p pNewey-West standard error 121112221221122
25、2var2cov,var2,where,var,cov,.nn tttttjttjnn ttjjxxttjtjtjtttjxtxux xu uTSSTSSx xxuu uTSSxbrr+_ _c co on ns s 2 29 9.5 57 74 49 97 7 2 2.3 30 02 25 57 79 9 1 12 2.8 84 4 0 0.0 00 00 0 2 24 4.9 92 28 81 18 8 3 34 4.2 22 21 17 76 6 p pr ro od du uc ct t .7 70 00 05 58 89 93 3 .0 02 26 60 07 71 1 2 26 6
26、.8 87 7 0 0.0 00 00 0 .6 64 47 79 97 76 6 .7 75 53 32 20 02 27 7 r rw wa ag ge es s C Co oe ef f.S St td d.E Er rr r.t t P P|t t|9 95 5%C Co on nf f.I In nt te er rv va al l N Ne ew we ey y-W We es st t P Pr ro ob b F F =0 0.0 00 00 00 0m ma ax xi im mu um m l la ag g:1 1 F F(1 1,4 42 2)=7 72 22 2.1
27、 13 3R Re eg gr re es ss si io on n w wi it th h N Ne ew we ey y-W We es st t s st ta an nd da ar rd d e er rr ro or rs s N Nu um mb be er r o of f o ob bs s =4 44 4.n ne ew we ey y r rw wa ag ge es s p pr ro od du uc ct t,l la ag g(1 1)Newey-West standard errorlNewey-West standard error corrects se
28、rial correlation as well as heteroskedasticity.If option lag is set to zero,then NW standard error is equivalent to White robust standard error.lnewey rwages products,lag(0)lreg rwages products,vce(robust)Main Point in this ChapterlSerial correlation:cov(ui,uj)0,i.e.E(ui,uj)0 lConcequence:OLS estima
29、tors will be still unbiased and consistentOLS estimators will not be efficient and variance of it is biased.t-statistics and F-statistic will be misleadinglTest serial correlationTime-sequence plotDurbin-Watson testlCorrection for serial correlation of AR(1)Generalize differencing.Newey West standard error