1、1C8.1(i) ,亦可以其他形式出现。01var(|)uXmale(ii) 首先估计 sleep 方程,得到残差平方序列,再以该残差平方为被解释变量对变量 male回归看其回归系数。use sleep75reg sleep totwrk educ age agesq yngkid malepredict r1, rg r1sq=r1*r1reg r1sq male其系数为负,说明男性的方差比女性要低。(iii)从回归结果中看,系数不显著,说明误差方差在男性和女性之间的差别不显著。C8.2clearuse hprice1reg price lotsize sqrft bdrmsestimate
2、s store reg1reg price lotsize sqrft bdrms, robustestimates store robustesttab reg1 robust, b(%8.6f) se mtitlereg lprice llotsize lsqrft bdrmsestimates store reg2reg lprice llotsize lsqrft bdrms, robustestimates store robust2esttab reg2 robust2, b(%8.6f) se mtitleC8.6clearuse crime1g arr86=(narr860)g
3、 lavgsen=log(avgsen)reg arr86 pcnv lavgsen tottimepredict arr86hatsum arr86hat/*加权最小二乘*/g h=arr86hat*(1-arr86hat)reg arr86 pcnv avgsen tottime ptime86 qemp86 aw=1/hC8.9(i)-(ii)clear2use smoke reg cigs lincome lcigpric educ age agesq restaurnpredict r1, rg lr1sq=log(r12)reg lr1sq lincome lcigpric edu
4、c age agesq restaurnpredict ghatg hhat=exp(ghat)reg cigs lincome lcigpric educ age agesq restaurn aw=1/hhat(iii)predict uhat, rpredict yhatg uhatsq=uhat2drop uhatsqg utild=uhat/(hhat0.5)g ytild=yhat/(hhat0.5)g utildsq=utild2g ytildsq=ytild2reg utildsq ytild ytildsqwhitetst, fitted/*表明仍然存在异方差*/(iv)第(iii)部分的结论表明,使用可行的加权最小二乘方法没有消除异方差性,对方差形式存在误设。(v) reg cigs lincome lcigpric educ age agesq restaurn aw=1/hhat, robust