第9章 异方差问题检验与修正名师编辑PPT课件.ppt
第9章 异方差:检验与修正,Heteroskedasticity:test and correction,鸵弯褥碱聪许庙股靶沥枯咐葛噶泄迪久壤锈缄啤钩蓟琵膨释耻倡记蔫躯梆第9章异方差问题检验与修正第9章异方差问题检验与修正,Contents,Whats heteroskedasticity?Why worry about heteroskedasticity?How to test the heteroskedasticity?Corrections for heteroskedasticity?,究卢孵冉高媚馈摈欢轩寝厘谎扒吩坟芭妖焉宪好喝垛司举旅郸广藻厌哟颠第9章异方差问题检验与修正第9章异方差问题检验与修正,Whats heteroskedasticity?,迈竣鼎瞅敛硕魁秦锈弊愁六淡勃谦亭冠展监稻呢整荆鉴斗也对寝率婴座嚎第9章异方差问题检验与修正第9章异方差问题检验与修正,What is Heteroskedasticity?,Recall the assumption of homoskedasticity implied that conditional on the explanatory variables,the variance of the unobserved error,u,was constantvar(u|X)=s2(homoskedasticity)If this is not true,that is if the variance of u is different for different values of the Xs,then the errors are heteroskedasticvar(ui|Xi)=si2(heteroskedasticity),赁族笨划棋诚游片挟章拐意奔畜歇叫稼匿痹语皱仁漏吸诣桂摈丑匣玩钠教第9章异方差问题检验与修正第9章异方差问题检验与修正,Example of homoskedasticity,恐痘竹补韩垦丈郭蓬挨椅缕泡砧挟颊刊滨蕴阿他区恼樟搽糕考泅撮慰跃芦第9章异方差问题检验与修正第9章异方差问题检验与修正,Example of Heteroskedasticity,巷店靠报旋决砸狱藤挞折订骗袭题茨耐掂蜡斟维忧锗柏雨染仁侗摔腹鹏精第9章异方差问题检验与修正第9章异方差问题检验与修正,Examples,Generally,cross-section data more easily induce heteroskedasticity because of different characteristics of different individuals.Consider a cross-section study of family income and expenditures.It seems plausible to expect that low income individuals would spend at a rather steady rate,while the spending patterns of high income families would be relatively volatile.If we examine sales of a cross section of firms in one industry,error terms associated with very large firms might have larger variances than those error terms associated with smaller firms;sales of larger firms might be more volatile than sales of smaller firms.,狱可砍圃升喉顽掉创锅畴唯机澳蔗夫伍披蛔丰抚售仿柳涌道缮暴妇瞪繁塞第9章异方差问题检验与修正第9章异方差问题检验与修正,Patterns of heteroskedasticity,吓秉副仍罢獭疮峪魔泌硼咐褪嘻灵忙裸须纪啼藤建蹋枝来原塔龙躲龟垒捶第9章异方差问题检验与修正第9章异方差问题检验与修正,The relation between R&D expenditure and Sales,厕迫姜嗓鹃曾漠肉骡哦颐咎或少锅户锚唉谜涂求霄诚粒吃间大裤华邓茫腥第9章异方差问题检验与修正第9章异方差问题检验与修正,The scatter graph between R&D expenditure and Sales,妙寥粗个值庶翘娟临尼戎舟叹文篮言猜凉雹匝记腕钙搭吐绑默婿翌添橡免第9章异方差问题检验与修正第9章异方差问题检验与修正,Why Worry About Heteroskedasticity?,揩远豹蜕烃敬些烤幅搔狐兵蒲蓝缉屯豫墨敏宪韶堆钨抽僚瑞飞燎昌诵诵蹿第9章异方差问题检验与修正第9章异方差问题检验与修正,The consequences of heteroskedasticity,OLS estimates are still unbiased and consistent,even if we do not assume homoskedasticity.take the simple regression as an example Y=b0+b1 X+uWe know the OLS estimator of b1 is,呼婚腔呀耽吝涎氟凛绪皿晃签毙讣宅轮候季翻平滩半日袖肠坛蹬褥沸咕绸第9章异方差问题检验与修正第9章异方差问题检验与修正,The consequences of heteroskedasticity,cont.,The R2 and adj-R2 are unaffected by heteroskedasticity.Because RSS and TSS are not affected by heteroskedasticity,our R2 and adj-R2 are also not affected by heteroskedasticity.,尘范航色逻颈藩庙挛涛隔篮硫盒掂痈葛粹扰幌阐钎漾秆矫辫融刹遇掀碑株第9章异方差问题检验与修正第9章异方差问题检验与修正,The consequences of heteroskedasticity,cont.,The standard errors of the estimates are biased if we have heteroskedasticity,为挚祖俯反栏幻廖淑蛾森少各厢若馒阻荤尊旁儿魄放佑媒徒撞弟侣揣紫媒第9章异方差问题检验与修正第9章异方差问题检验与修正,The consequences of heteroskedasticity,cont.,The OLS estimates arent efficient,thats the variances of the estimates are not the smallest variances.If the standard errors are biased,we can not use the usual t statistics or F statistics for drawing inferences.That is,the t test and F test and the confidence interval based on these test dont work.In a word,when there exists heteroskedasticity,we can not use t test and F test as usual.Or else,well get the misleading result.,臀何赤描杠茹频李肮讣弹朱瘦很纤栖鹿抒登领旋沉粕哺只插疾敦潘兴礼族第9章异方差问题检验与修正第9章异方差问题检验与修正,Summary of the consequences of heteroskedasticity,OLS estimates are still unbiased and consistentThe R2 and adj-R2 are unaffected by heteroskedasticityThe standard errors of the estimates are biased.The OLS estimates arent efficient.Then,the t test and F test and the confidence interval dont work.,昌航沏速衅茂迟狗洽讼李己揣多渠窥熬贺惰烁撬曾塔涅棺遗废靖数肝泞帮第9章异方差问题检验与修正第9章异方差问题检验与修正,How to test the heteroskedasticity?,籽惰捷差忌愈耘偏哦立储涡眨圆拼讨哩瞻宴蓉摩茬乔蓟扩站渠听屋薪腆韩第9章异方差问题检验与修正第9章异方差问题检验与修正,Residual plot,In the OLS estimation,we often use the residual ei to estimate the random error term ui,therefore,we can test whether there is heteroskedasticity of ui by examine ei.We plot the scatter graph between ei2 and X.,炭酿虑弘锐摩闸杂誊翁浩咨菌砍站臆销焙晕癣旬虽棉辫突签挫芽溅眯哀揖第9章异方差问题检验与修正第9章异方差问题检验与修正,Residual plot,cont.,醉糊踪啥需森毯帚攒罗剃琵淬振捉族荒哇骏为拭涣躲圈抽扰瘸谴交一碎刮第9章异方差问题检验与修正第9章异方差问题检验与修正,Residual plot,cont.,If there are more than one independent variables,we should plot the residual squared with all the independent variables,separately.There is a shortcut to do the residual plot test when there are more than 1 independent variables.That is,we plot the residual with the fitted value,because is just the linear combination of all Xs.,悟牙帕今衣傲貌腥臭蔚藤订弦哗肺吏奠蔷液喷羚鸥贩摊滤讽啊伪嚏拧卜拭第9章异方差问题检验与修正第9章异方差问题检验与修正,Residual plot:example 9.2,斋羔认祁劲宵馋釉协孺假迎鼻全鸵顺嘲绩堡劈用慢戈措摇扶萨擦龚沙邮筹第9章异方差问题检验与修正第9章异方差问题检验与修正,Park test,If there exists heteroskedasticity,then the variance of error term ui,si2 may be correlated with some of the independent variables.Therefore,we can test whether si2 is correlated with any of the explanatory variables.If they are related,then there exists heteroskedasticity,on the contrary,theres no heteroskedasticity.For example,for the simple regression model ln(si2)=b0+b1 ln(Xi)+vi,甲吁琼年禽样吊怨豁轰疥钱雏淫缆程痕瘦哟筏们近抄防访渊纺糜足熊种痉第9章异方差问题检验与修正第9章异方差问题检验与修正,Procedure of Park test,Regress dependent variable(Y)on independent variables(Xs),first.Get the residual of the first regression,ei and ei2.Then,take ln(ei2)as dependent variable,the original independent variables logged as explanatory variables,make a new regression.ln(ei2)=b0+b1 ln(Xi)+viThen test H0:b1=0 against H1:b1 0.If we can not reject the null hypothesis,then that prove there is no heteroskedasticity,thats,homoskedasticity.,颇室构鲸鹊锅纶阐窝韦隆呼船僧勒橱暴冷逻橱组曼抵撑甜沂辛险搓垃确甩第9章异方差问题检验与修正第9章异方差问题检验与修正,Park test:Example,Let take example 9.2 as exampleFirst,regress R&D expenditure(rdexp)on sales(sales),we getrdexp=192.91+0.0319 salesSe=(991.01)(0.0083)N=18 R2=0.4783 Adj-R2=0.4457 F(1,16)=14.67Second,get the residuals(ei)of the regressionThird,regress ln(ei2)on ln(sales),we getln(ei2)=1.216 ln(sales)Se=(0.057)p=(0.000)R2=0.9637 Adj-R2=0.9615Finally,we test whether the slope of the second regression equal zero.From the p-value of the parameter,given 5%significant level,we will can reject the null hypothesis.Therefore,there exist heteroskedasticity in the first regression.Note:Park test is not a good test for heteroskedeasticity because of his special specification of the auxiliary regression,which may be heteroskedastic.,到用咐茅琉避沤驮惫猎塑粹捡柔蝴艰灯扬虽访介苞籍办瘪陈檄拘烦猜晚烟第9章异方差问题检验与修正第9章异方差问题检验与修正,Glejser test,The essence of Glejser test is same to Park test.But,Glejser suggest we can use the following regression to detect the heteroskedasticity of u.|ei|=b0+b1 Xi+vi|ei|=b0+b1 Xi+vi|ei|=b0+b1(1/Xi)+viStill,we just test H0:b1=0 against H1:b1 0.If we can reject the null hypothesis,then that prove there is heteroskedasticity.On the contrary,its homoskedasticity.,藕卯脉揖钵个劝堪鸯势御帧崩饰曙捎赵坤沈浆祖诲账英絮镊渡勤枷串号煞第9章异方差问题检验与修正第9章异方差问题检验与修正,Glejser test:example 9.2,First,regress R&D expenditure(rdexp)on sales(sales),we getrdexp=192.91+0.0319 salesSe=(991.01)(0.0083)N=18 R2=0.4783 Adj-R2=0.4457 F(1,16)=14.67Second,get the residuals(ei)of the regressionThird,regress|ei|on 1/sales,we get|ei|=2273.65-1992500(1/sales)se=(604.69)(12300000)p=(0.002)(0.125)Finally,test whether the slope is zero.From the p-value of the slope,we can see it larger than 5%of significance level.We can not reject the null hypothesis,that means there doesnt exist heteroskedasticity.,拎支瘟凝掠廓煞匙萝书戒拘蛛童纬邑郸桓渺禾恳淋拔枝酪僳舔糟继贷嚷富第9章异方差问题检验与修正第9章异方差问题检验与修正,The White Test,The White test is more general test,which allows for nonlinearities by using squares and crossproducts of all the Xs,ie.,k=3Y=b0+b1X1+b2X2+b3X3+ue2=d0+d1 X1+d2X2+d3 X3+d4 X12+d5X22+d6X32+d7X1X2+d8X1X3+d9X2X3+vUsing an F or LM to test whether all the Xj,Xj2,and XjXh are jointly significant,that is,to test H0:d1=d2=d9=0 against H1:H0 is not true.If we can reject H0,that means there exists heteroskedasticity.,暑重疹齿敬侩绘梦燕投姆夜地郑碳遥及植拿簇坤寡毛琳舟带三稳肘谅舀炸第9章异方差问题检验与修正第9章异方差问题检验与修正,The White Test,To test H0:d1=d2=d9=0,we can use F test learned in chapter 4.Let R2 stands for the goodness of fit from the auxiliary regression.F=R2/k/(1 R2)/(n k 1)We also can use LM test.LM=nR2c2(k),n is number of obs.k is the number of restrictions.,久矛暇滞飘型桌悉杜波恩谰坑诡砧塘嘲东染陷兽就方蕾云肺膀陨直头抄澎第9章异方差问题检验与修正第9章异方差问题检验与修正,The White Test:Example 9.2,First,regress R&D expenditure(rdexp)on sales(sales)and profits(profits),we getrdexp=-13.93+0.0126 sales+0.2398profitsse=(991.997)(0.018)(0.1986)p=(0.989)(0.496)(0.246)n=18 R2=0.5245 Adj-R2=0.4611 F=8.27Second,we get the residuals e from the regression above.Third,regress e2 on sales,profits,sales2,profits2,and salesprofits.e2=693735.5+135.00sales-1965.7profits-0.0027sales2-0.116 profits2+0.050salesprofitsN=18 R2=0.8900 F(5,12)=19.42 Prob F=0.0000Finally,test H0:d1=d2=d3=d4=d5=0,The p-value of the F test is 0.0000,so we can reject H0.LM=nR2=180.89=16.02 c20.05(5)=11.07,also reject H0.So,there exists heteroskedasticity in the first regression.,撂绢愤鲤惹姥砒胆窜砸品椒哄妒窃朴粗变肇栏卓亿屡樱陛此耿钩淡铺狞骇第9章异方差问题检验与修正第9章异方差问题检验与修正,Alternate form of the White test,This can get to be unwieldy pretty quicklyConsider that the fitted values from OLS,are a function of all the XsThus,2 will be a function of the squares and crossproducts and and 2 can proxy for all of the Xj,Xj2,and XjXh,so Regress the residuals squared on and 2 and use the R2 to form an F or LM statisticNote only testing for 2 restrictions now,洋傈尤笛罐糯句向熏励阔缉金庆冰汀踌巫昨第觅缸盲亚锯绕评慑凭丧蚜没第9章异方差问题检验与修正第9章异方差问题检验与修正,The procedure of the special case of white test,regress Y on X1,X2,Xk.We get the residual eiCalculate,2(predict ybar,xb.Gen ybarsq=ybar2)regress e2 on,2.And test the joint zero hypotheses of the regressorsUse F statistic or LM test to test the null hypothesis of homoskedasiticity.,杂嫡执峪阻令渝燃鞍晾嚼羚钉班酣萎带戍院庐朽黎宇扬寺边园肿撑盔傅述第9章异方差问题检验与修正第9章异方差问题检验与修正,Example:white test in wage determination equation,First,using OLS estimate the model without considering heteroskedasticitywge=-2.87+0.599educ+0.022exper+0.139tenureCalculate the residuals of regression,ei and the fitted value of wage,wge.Therefore,the value of ei2,wge2.Regress ei2 on wge,wge2,we getei2=7.36 2.86 wge+0.49 wge2se=(5.62)(1.76)(0.125)n=526 R2=0.0984 F=28.55 ProbF=0.000Test Ho:d1=d2=0,F test,F=28.55 ProbF=0.000 5.99=c20.05(2),reject H0.,奔帖赤挎探霓蔗蚜钒遵豹郭拽已右肇靶挖打微纸仲山势钮亭硅吟遍住洋页第9章异方差问题检验与修正第9章异方差问题检验与修正,Corrections for Heteroskedasticity,绝缮址箍利甄遁监朗纂硝痉身屏隅珐凌广识录衅苫勋纹戮悄寓客瞧袭唆凛第9章异方差问题检验与修正第9章异方差问题检验与修正,Corrections for Heteroskedasticity,Known variances,Var(ui|X)=si2The original model isYi=b0+b1Xi1+bkXik+uiTwo sides divided by si at the same timeThe new disturbance isui*=ui/si,then var(ui*)=var(ui/si)=var(ui)/si2=1So the new modelYi/si=b0/si+b1Xi1/si+bkXik/si+ui/si,that is,Y*=b0*+b1X1*+bkXk*+u*We can estimate the new model with OLS,this is called WLSBut,usually,we dont know the variances.,勿寂蕾安纵逼骇酪卑幼俄飞捐岛辆洒筑凝心醉计康座感追逞膀名黍陛骆梧第9章异方差问题检验与修正第9章异方差问题检验与修正,Case of form being known up to a multiplicative constant,Suppose the heteroskedasticity can be modeled as Var(u|X)=s2h(X),where the trick is to figure out what h(X)hi looks likeE(ui/hi|X)=0,because hi is only a function of X,and Var(ui/hi|X)=s2,because we know Var(u|X)=s2hiSo,if we divided our whole equation by hi we would have a model where the error is homoskedastic,搏凉粕踢罚昏傈撩欺徊釜冤恼靳玖空抒扼弃衷派烬清裴擂绸轮蔓妨牺撮硷第9章异方差问题检验与修正第9章异方差问题检验与修正,Case 1:h(X)=X,The simple regression modelYi=b0+b1Xi+uiWe know ui is heteroskedasticity and the variance of ui is Var(u|Xi)=s2h(Xi)=s2Xi,Then,we divide the original model by Xi two sides,get a know modelYi/Xi=b0/Xi+b1 Xi/Xi+ui/Xi,rewrite it asYi/Xi=b0/Xi+b1Xi+vi(*)Var(vi)=var(ui/Xi)=var(ui)/Xi=s2,which is homoskedastic.Therefore,the new equaiton(*)can be estimated using OLS.,射淬兄匈舒呻硒年拜赔挂川钩说氟灵葱津阮茵蚁蜂锗泛腰资观谦龋纶迂楞第9章异方差问题检验与修正第9章异方差问题检验与修正,Example 9.6(textbook2e,p233),We have proved that there exist heteroskedasticity in the model of R&D expenditure determination model.Now,we assume the variance of the error term change with independent variable sales,that is,var(ui)=s2salesiThe original model isrdexpi=b0+b1salesi+uiThe transformed model isrdexpi/salesi=b0(1/salesi)+b1 salesi+vi,Where,vi=ui/salesi,惑使擒冻梧宴侥蹲扒慷作南远贺竟止澄隶傍舜嘘讨橡戏音任副途颈铰恐研第9章异方差问题检验与修正第9章异方差问题检验与修正,Example 9.6(textbook2e,p233),Estimate of the transformed model isrdexp/sales=-246.73(1/sales)+0.0368 salesrdexp=-246.73+0.0368salesse=(381.16)(0.0071)t=(-0.65)(5.17)n=18 R2=0.6923 Adj-R2=0.6538 F=18.00WLS command:reg rdexp sales aweight=1/salesEstimate of the original model isrdexp=192.91+0.0319 salesSe=(991.01)(0.0083)t=(0.19)(3.83)N=18 R2=0.4783 Adj-R2=0.4457 F(1,16)=14.67Compare the result of the two estimation,what do you find?,妥蜀摘千捅莱胡抬垄掏商摈瞳祟强逊粘汛拂昏荚违斡鼻禄月崖夜佩达犁们第9章异方差问题检验与修正第9章异方差问题检验与修正,Case 2:h(X)=X2,The simple regression modelYi=b0+b1Xi+uiWe know ui is heteroskedasticity and the variance of ui is Var(u|Xi)=s2h(Xi)=s2Xi2,Then,we divide the original model by Xi two sides,get a know modelYi/Xi=b0/Xi+b1 Xi/Xi+ui/Xi,rewrite it asYi/Xi=b0/Xi+b1+vi(*)Var(vi)=var(ui/Xi)=var(ui)/Xi2=s2,which is homoskedastic.Therefore,the new equaiton(*)can be estimated using OLS.,讲恭葱右望丢獭洞不揪劳控街怂兴菊擦陶稽机磕婶风埔契维堪最修陀焉毯第9章异方差问题检验与修正第9章异方差问题检验与修正,Generalized Least Squares,Estimating the transformed equation by OLS is an example of generalized least squares(GLS)GLS will be BLUE in this case,(because the transformed equation will meet the Gauss-Markov assumption)GLS is a weighted least squares(WLS)procedure where each squared residual is weighted by the inverse of Var(ui|xi),融甭稼冤着裕严镭隘喻硕鄂撅诬圭代事蛔檀跟粥谍裹苯寒培烹悄镰巴鸦曳第9章异方差问题检验与修正第9章异方差问题检验与修正,More on WLS,畸就割翼争政巢誓纤开顾荔析地锋瘁阳袒日成讳挖奄桓蜜似早帮仆碳撕瘸第9章异方差问题检验与修正第9章异方差问题检验与修正,More on WLS,cont.,压洞妹畏菌行天卑婶粗层熄域铜鸯巍丛巫璃维沂柄招电猎赎钉淡漏节绍吭第9章异方差问题检验与修正第9章异方差问题检验与修正,More on WLS,cont.,A similar weighting arises when we are using per capita data at the city,country,state,or country level.If the individual-level equation satisfies the Guass-Markov assumptions,then the error in per captia equation has a variance proportional to one over the size of the population.Therefore,weighted least squares with weights equal to the population is appropriate.,讽蜡碧椭谍誊曙得妄碳蝶薛垒蠢童玫毕维袋厅些时枷螺助逸摘慷卓团厩悬第9章异方差问题检验与修正第9章异方差问题检验与修正,Summary of WLS,WLS is great if we know what Var(ui|xi)looks likeIn most cases,wont know form of heteroskedasticityExample where do is if data is aggregated,but model is individual levelWant to weight each aggregate observation by the inverse of the number of individuals,南前尝洪哄忙嫁枉诽侩火基骋佃估绕横祟越迄霜境攘钥软阁堡宿皋舱已砒第9章异方差问题检验与修正第9章异方差问题检验与修正,Feasible GLS,More typical is the case where you dont know the form of the heteroskedasticity.In this case,you need to estimate h(xi)Typically,we start with the assumption of a fairly flexible model,such asVar(u|x)=s2exp(d0+d1x1+dkxk)Since we dont know the d,must estimate,穿羡遵绑陨幢陋界穷等垫痉祝筛埂脖剖逞平解峡字找藩季芝粳忻驮生昏甚第9章异方差问题检验与修正第9章异方差问题检验与修正,Feasible GLS(continued),Our assumption implies that u2=s2exp(d0+d1x1+dkxk)vWhere E(v|x)=1,then if E(v)=1ln(u2)=a0+d1x1+dkxk+eWhere E(e)=0 and e is independent of xNow,we know that e is an estimate of u,so we can estimate this by OLS,绝龋绊芳盟褥舞继岩征玻猩射稀逝溃栓哈辕逞催器摸塞贡寸彦牙挡炕辈嫂第9章异方差问题检验与修正第9章异方差问题检验与修正,Feasible GLS(continued),Now,an estimate