《《异方差例题》word版.doc》由会员分享,可在线阅读,更多相关《《异方差例题》word版.doc(10页珍藏版)》请在taowenge.com淘文阁网|工程机械CAD图纸|机械工程制图|CAD装配图下载|SolidWorks_CaTia_CAD_UG_PROE_设计图分享下载上搜索。
1、第五章习题答案演示一、数据如下:(表5.1)YX264877710592109099541311050812210979107119124061274750313499431142695881552289816730950176637791857581919635122221163170222880157824127165425604140026500182926760220028300201727430210529560160028150225032100242032500257035250172033500190036000210036200280028200二、数据输入EVIEWS软件,
2、注意输入过程中要定义e2“quick”菜单下“estimate equation”结果如下:(表5.2)Dependent Variable: YMethod: Least SquaresDate: 04/13/08 Time: 16:01Sample: 1 31Included observations: 31VariableCoefficientStd. Errort-StatisticProb. C-700.4110116.6679-6.0034580.0000X0.0878310.00482718.195750.0000R-squared0.919464 Mean dependent
3、var1266.452Adjusted R-squared0.916686 S.D. dependent var846.7570S.E. of regression244.4088 Akaike info criterion13.89790Sum squared resid1732334. Schwarz criterion13.99042Log likelihood-213.4175 F-statistic331.0852Durbin-Watson stat1.089829 Prob(F-statistic)0.000000最小二乘估计结果如下:Estimation Command:=LS
4、Y C XEstimation Equation:=Y = C(1) + C(2)*XSubstituted Coefficients:=Y = -700.4109607 + 0.08783115594*X三、检验模型的异方差:(一)图形法1、EViews软件操作。由路径:Quick/Qstimate Equation,进入Equation Specification窗口,键入“y c x”,确认并“ok”,得样本回归估计结果,见表5.2。(1) 生成残差平方序列。在得到表5.2估计结果后,回到以下界面:点击“procs”下的“generate series”菜单,输入公式“e2=(resid
5、)2”回到以下界面(e2已经生成,即残差序列生成):(2) 在该界面下:单击“views”菜单下的“multple graphs”下的“scatter”, 操作如下: (3) 显示结果如下(图5.1):(4)从图5.3分析可知:大致看出残差平方随的变动呈增大的趋势,因此,模型很可能存在异方差。但是否确实存在异方差还应通过更进一步的检验。(二)Goldfeld-Quanadt检验1、EViews软件操作。(1)对变量取值排序(按递增或递减)。在Procs菜单里选Sort Series命令,出现排序对话框,如果以递增型排序,选Ascenging,如果以递减型排序,则应选Descending,键入X
6、,点ok。本例选递增型排序,这时变量Y与X将以X按递增型排序。(2)构造子样本区间,建立回归模型。在本例中,样本容量n=31,删除中间1/4的观测值,即大约9个观测值,余下部分平分得两个样本区间:111和2131,它们的样本个数均是11个,即。由路径:Quick/Qstimate Equation,进入Equation Specification窗口,键入“y c x”,确认并“ok”,得样本回归估计结果,(注意:sample:1 11)(表5.3)Dependent Variable: YMethod: Least SquaresDate: 04/13/08 Time: 22:26Sampl
7、e: 1 11Included observations: 11VariableCoefficientStd. Errort-StatisticProb. C-744.6351195.4108-3.8106140.0041X0.0882580.0157055.6196190.0003R-squared0.778216 Mean dependent var331.3636Adjusted R-squared0.753574 S.D. dependent var260.8157S.E. of regression129.4724 Akaike info criterion12.72778Sum s
8、quared resid150867.9 Schwarz criterion12.80012Log likelihood-68.00278 F-statistic31.58011Durbin-Watson stat1.142088 Prob(F-statistic)0.000326Estimation Command:=LS Y C XEstimation Equation:=Y = C(1) + C(2)*XSubstituted Coefficients:=Y = -744.6350676 + 0.08825777732*X由路径:Quick/Qstimate Equation,进入Equ
9、ation Specification窗口,键入“y c x”,确认并“ok”,得样本回归估计结果,(注意:sample:21 31)注意:期间是21 31输出结果如下(表5.4):Dependent Variable: YMethod: Least SquaresDate: 04/14/08 Time: 10:27Sample: 21 31Included observations: 11VariableCoefficientStd. Errort-StatisticProb. C666.3811911.25850.7312760.4832X0.0457790.0278981.6409710
10、.1352R-squared0.230295 Mean dependent var2152.909Adjusted R-squared0.144772 S.D. dependent var354.4462S.E. of regression327.7867 Akaike info criterion14.58557Sum squared resid966997.0 Schwarz criterion14.65791Log likelihood-78.22063 F-statistic2.692786Durbin-Watson stat2.743586 Prob(F-statistic)0.13
11、5222Estimation Command:=LS Y C XEstimation Equation:=Y = C(1) + C(2)*XSubstituted Coefficients:=Y = 666.3810693 + 0.04577902024*X(3)求F统计量值。基于表5.3和表5.4中残差平方和的数据,即Sum squared resid的值。由表5.3计算得到的残差平方和为,由表5.4计算得到的残差平方和为,根据Goldfeld-Quanadt检验,F统计量为 (5.1)(4)判断。在下,式(5.1)中分子、分母的自由度均为11,查F分布表得临界值为,因为,所以拒绝原假设,表
12、明模型确实存在异方差。(三)White检验由表5.2估计结果,按路径view/residual tests/white heteroskedasticity(no cross terms or cross terms),进入White检验。根据White检验中辅助函数的构造,最后一项为变量的交叉乘积项,因为本例为一元函数,故无交叉乘积项,因此应选no cross terms,则辅助函数为 (5.2)经估计出现White检验结果,见表5.5。从表5.5可以看出,由White检验知,在下,查分布表,得临界值(在(5.2)式中只有两项含有解释变量,故自由度为2),比较计算的统计量与临界值,因为,所以
13、拒绝原假设,不拒绝备择假设,表明模型存在异方差。表5.5White Heteroskedasticity Test:F-statistic5.819690 Probability0.007699Obs*R-squared9.102584 Probability0.010554Test Equation:Dependent Variable: RESID2Method: Least SquaresDate: 04/14/08 Time: 11:02Sample: 1 31Included observations: 31VariableCoefficientStd. Errort-Statist
14、icProb. C19975.9882774.930.2413290.8111X-2.1986328.094419-0.2716230.7879X20.0001460.0001760.8300460.4135R-squared0.293632 Mean dependent var55881.73Adjusted R-squared0.243177 S.D. dependent var77875.67S.E. of regression67748.39 Akaike info criterion25.17675Sum squared resid1.29E+11 Schwarz criterion
15、25.31553Log likelihood-387.2397 F-statistic5.819690Durbin-Watson stat2.580140 Prob(F-statistic)0.007699四、异方差性的修正 (一)加权最小二乘法(WLS)在运用WLS法估计过程中,我们分别选用了权数。权数的生成过程如下,由图5.4,的主菜单中点击“quick”下的“Estimation Equation”键,输入公式:Y C X,同时,点击“option”键,在菜单中“weight”后面的空白处输入“1/X”,点击该键,输入权重权重:可赋予不同形式,目标是消除异方差下面仅给出用权数W1t的结果
16、。Dependent Variable: YMethod: Least SquaresDate: 04/25/08 Time: 22:28Sample: 1 31Included observations: 31Weighting series: 1/XVariableCoefficientStd. Errort-StatisticProb. C-742.468471.91567-10.324150.0000X0.0897510.00434720.646960.0000Weighted StatisticsR-squared0.786117 Mean dependent var903.0766
17、Adjusted R-squared0.778742 S.D. dependent var406.6195S.E. of regression191.2661 Akaike info criterion13.40755Sum squared resid1060899. Schwarz criterion13.50006Log likelihood-205.8170 F-statistic426.2970Durbin-Watson stat1.081175 Prob(F-statistic)0.000000Unweighted StatisticsR-squared0.919023 Mean d
18、ependent var1266.452Adjusted R-squared0.916231 S.D. dependent var846.7570S.E. of regression245.0763 Sum squared resid1741810.Durbin-Watson stat1.074712基于上述结果的E残差WHITE检验White Heteroskedasticity Test:F-statistic0.986241 Probability0.385562Obs*R-squared2.040103 Probability0.360576Test Equation:Dependen
19、t Variable: STD_RESID2Method: Least SquaresDate: 06/03/11 Time: 08:47Sample: 1 31Included observations: 31VariableCoefficientStd. Errort-StatisticProb. C110552.854963.862.0113730.0540X-7.3424685.374822-1.3660860.1828X20.0001510.0001171.2934010.2064R-squared0.065810 Mean dependent var34222.55Adjusted R-squared-0.000918 S.D. dependent var44965.37S.E. of regression44986.00 Akaike info criterion24.35786Sum squared resid5.67E+10 Schwarz criterion24.49663Log likelihood-374.5468 F-statistic0.986241Durbin-Watson stat1.733930 Prob(F-statistic)0.385562TR2=31*0.065810=2.04011X2(g),结果表明,加权最小二乘法后为同方差。