异方差与序列相关性练习演示教学.doc

上传人:1595****071 文档编号:52340833 上传时间:2022-10-22 格式:DOC 页数:40 大小:485KB
返回 下载 相关 举报
异方差与序列相关性练习演示教学.doc_第1页
第1页 / 共40页
异方差与序列相关性练习演示教学.doc_第2页
第2页 / 共40页
点击查看更多>>
资源描述

《异方差与序列相关性练习演示教学.doc》由会员分享,可在线阅读,更多相关《异方差与序列相关性练习演示教学.doc(40页珍藏版)》请在得力文库 - 分享文档赚钱的网站上搜索。

1、Good is good, but better carries it.精益求精,善益求善。异方差与序列相关性练习-一、异方差检验与修正(一)建立初始回归模型相关命令:dataxyscatxylsycx模型一:DependentVariable:YMethod:LeastSquaresDate:10/23/14Time:10:46Sample:120Includedobservations:20VariableCoefficientStd.Errort-StatisticProb.C272.3635159.67731.7057130.1053X0.7551250.02331632.386900

2、.0000R-squared0.983129Meandependentvar5199.515AdjustedR-squared0.982192S.D.dependentvar1625.275S.E.ofregression216.8900Akaikeinfocriterion13.69130Sumsquaredresid846743.0Schwarzcriterion13.79087Loglikelihood-134.9130F-statistic1048.912Durbin-Watsonstat1.301684Prob(F-statistic)0.000000(二)异方差的四种检验方法及其分

3、析右击resid选择ObjectCopy,输入e得到初始回归模型的残差序列;1.图示法:scatxe22.模型检验法:lse2cxDependentVariable:E2Method:LeastSquaresDate:10/23/14Time:10:52Sample:120Includedobservations:20VariableCoefficientStd.Errort-StatisticProb.C-65281.6621544.58-3.0300730.0072X16.493443.1458955.2428430.0001R-squared0.604286Meandependentva

4、r42337.15AdjustedR-squared0.582302S.D.dependentvar45279.67S.E.ofregression29264.05Akaikeinfocriterion23.50075Sumsquaredresid1.54E+10Schwarzcriterion23.60032Loglikelihood-233.0075F-statistic27.48740Durbin-Watsonstat1.029463Prob(F-statistic)0.0000553.GQ假设检验法首先,点击工具按钮proc选择sortcurrentpage,输入X,按升序排序;去掉中

5、间约n/4个样本点,然后对前后两个子样本分别进行回归;子样本模型一:DependentVariable:YMethod:LeastSquaresDate:10/23/14Time:10:57Sample:18Includedobservations:8VariableCoefficientStd.Errort-StatisticProb.C1277.1611540.6040.8290000.4388X0.5541260.3114321.7792870.1255R-squared0.345397Meandependentvar4016.814AdjustedR-squared0.236296S.

6、D.dependentvar166.1712S.E.ofregression145.2172Akaikeinfocriterion13.00666Sumsquaredresid126528.3Schwarzcriterion13.02652Loglikelihood-50.02663F-statistic3.165861Durbin-Watsonstat3.004532Prob(F-statistic)0.125501子样本模型二:DependentVariable:YMethod:LeastSquaresDate:10/23/14Time:10:57Sample:1320Includedob

7、servations:8VariableCoefficientStd.Errort-StatisticProb.C212.2118530.88920.3997290.7032X0.7618930.06034812.625050.0000R-squared0.963723Meandependentvar6760.477AdjustedR-squared0.957676S.D.dependentvar1556.814S.E.ofregression320.2790Akaikeinfocriterion14.58858Sumsquaredresid615472.0Schwarzcriterion14

8、.60844Loglikelihood-56.35432F-statistic159.3919Durbin-Watsonstat1.722960Prob(F-statistic)0.000015根据得到的RSS1与RSS2,求得F检验统计量值。F=RSS2/RSS1=615472.0/126528.3=4.86;查F分布表,确定临界值F0.05(6,6);若FF0.05(6,6)则拒绝H0,认为原初始模型的随机误差项存在显著的异方差;反之则认为不存在显著的异方差问题。4.怀特检验法:打开初始模型一,点击View工具按钮,选择residualtests右拉列表选择WhiteHeteroskeda

9、sticityTest(crossterms)WhiteHeteroskedasticityTest:F-statistic14.63595Probability0.000201Obs*R-squared12.65213Probability0.001789TestEquation:DependentVariable:RESID2Method:LeastSquaresDate:10/23/14Time:11:24Sample:120Includedobservations:20VariableCoefficientStd.Errort-StatisticProb.C-180998.910331

10、8.2-1.7518580.0978X49.4284628.939291.7080060.1058X2-0.0021150.001847-1.1447420.2682R-squared0.632606Meandependentvar42337.15AdjustedR-squared0.589384S.D.dependentvar45279.67S.E.ofregression29014.92Akaikeinfocriterion23.52649Sumsquaredresid1.43E+10Schwarzcriterion23.67585Loglikelihood-232.2649F-stati

11、stic14.63595Durbin-Watsonstat2.081758Prob(F-statistic)0.000201首先根据上方假设检验统计量及其伴随概率可知,Obs*R-squared=12.65,判断与2个自由度的卡方统计量临界值的大小关系,得出具体假设检验结果,原理类似于F检验。(二)异方差的修正方法及其分析加权最小二乘法WLS首先点击主菜单QuickEstimateEquation,在空白区域输入模型形式YCX,点击右上方Option按钮,选中左侧中间的WLS法,在W空白区域输入权变量1/abs(e),回车即可得到加权以后的回归模型。DependentVariable:YMet

12、hod:LeastSquaresDate:10/23/14Time:11:12Sample:120Includedobservations:20Weightingseries:1/ABS(E)VariableCoefficientStd.Errort-StatisticProb.C415.6603116.97913.5532880.0023X0.7290260.02242932.503490.0000WeightedStatisticsR-squared0.999895Meandependentvar4471.606AdjustedR-squared0.999889S.D.dependentv

13、ar7313.160S.E.ofregression77.04831Akaikeinfocriterion11.62138Sumsquaredresid106856.0Schwarzcriterion11.72096Loglikelihood-114.2138F-statistic1056.477Durbin-Watsonstat2.367808Prob(F-statistic)0.000000UnweightedStatisticsR-squared0.981664Meandependentvar5199.515AdjustedR-squared0.980645S.D.dependentva

14、r1625.275S.E.ofregression226.1101Sumsquaredresid920263.9Durbin-Watsonstat1.886959对加权修正以后的模型进行怀特异方差检验,以确定异方差问题是否消除,步骤同前。WhiteHeteroskedasticityTest:F-statistic0.032603Probability0.967983Obs*R-squared0.076420Probability0.962511TestEquation:DependentVariable:STD_RESID2Method:LeastSquaresDate:10/23/14Ti

15、me:11:25Sample:120Includedobservations:20VariableCoefficientStd.Errort-StatisticProb.C6196.48111798.680.5251840.6062X-0.1653233.304793-0.0500250.9607X24.80E-060.0002110.0227450.9821R-squared0.003821Meandependentvar5342.798AdjustedR-squared-0.113377S.D.dependentvar3140.196S.E.ofregression3313.430Akai

16、keinfocriterion19.18684Sumsquaredresid1.87E+08Schwarzcriterion19.33620Loglikelihood-188.8684F-statistic0.032603Durbin-Watsonstat2.153876Prob(F-statistic)0.967983非常明显地判断出异方差性问题已经消除,上面加权修正后的模型即可作为最终模型。二、随机误差项序列相关性问题的检验与修正(一)建立初始回归模型相关命令:dataxyscatxylsycx模型一:DependentVariable:YMethod:LeastSquaresDate:0

17、7/29/12Time:09:48Sample:19912011Includedobservations:21VariableCoefficientStd.Errort-StatisticProb.C178.975555.064213.2503050.0042X0.0200020.00113417.641570.0000R-squared0.942463Meandependentvar922.9095AdjustedR-squared0.939435S.D.dependentvar659.3491S.E.ofregression162.2653Akaikeinfocriterion13.106

18、73Sumsquaredresid500270.3Schwarzcriterion13.20621Loglikelihood-135.6207F-statistic311.2248Durbin-Watsonstat0.658849Prob(F-statistic)0.000000初始回归模型一经济意义合理,统计指标较为理想,但DW值偏低,模型可能存在序列相关性。(二)序列相关性的四种检验方法及其分析右击resid选择ObjectCopy,输入e得到初始回归模型的残差序列;1.图示法:scate(-1)e散点图形略2.自回归模型检验法一阶自回归为:lsee(-1)DependentVariabl

19、e:EMethod:LeastSquaresDate:07/29/12Time:09:49Sample(adjusted):19922011Includedobservations:20afteradjustmentsVariableCoefficientStd.Errort-StatisticProb.E(-1)0.7170800.2018523.5524970.0021R-squared0.398929Meandependentvar2.801737AdjustedR-squared0.398929S.D.dependentvar161.7297S.E.ofregression125.38

20、70Akaikeinfocriterion12.54939Sumsquaredresid298716.2Schwarzcriterion12.59918Loglikelihood-124.4939Durbin-Watsonstat1.080741说明模型一的随机误差项至少存在一阶正序列相关性,结合该自回归模型的DW值为1.08,怀疑存在更高阶的序列相关,继续引入e(-2)如下:lsee(-1)e(-2)DependentVariable:EMethod:LeastSquaresDate:07/29/12Time:09:49Sample(adjusted):19932011Includedobs

21、ervations:19afteradjustmentsVariableCoefficientStd.Errort-StatisticProb.E(-1)1.0949740.1787686.1251080.0000E(-2)-0.8150100.199977-4.0755130.0008R-squared0.692885Meandependentvar7.790341AdjustedR-squared0.674819S.D.dependentvar164.5730S.E.ofregression93.84710Akaikeinfocriterion12.02051Sumsquaredresid

22、149723.7Schwarzcriterion12.11993Loglikelihood-112.1949Durbin-Watsonstat1.945979由于e(-2)的t检验显著,说明模型一的随机误差项确实存在二阶正序列相关性,结合该二阶自回归模型的DW值为1.95,基本确定不存在更高阶的序列相关。Breusch-GodfreySerialCorrelationLMTest:F-statistic0.888958Probability0.431668Obs*R-squared1.998924Probability0.368077可以看出二阶自回归模型的随机误差项不存在序列相关性,论证了原

23、模型仅存在二阶序列相关。3.DW检验法0DWdL存在正自相关(趋近于0)DLDWdU不能确定DUDW4dU无自相关(趋近于2)4.LM检验法原理:一方面,根据上面的假设检验结果判断是否存在序列相关性,即根据(n-p)*R2统计量值与卡方检验临界值2(P)进行比较,其中n为原模型样本容量,P为选择的滞后阶数,R2为下面辅助回归模型的可决系数。若(n-p)*R22(P),则拒绝不序列相关的原假设,说明模型存在显著的序列相关性;另一方面,结合下面的辅助回归模型中残差滞后变量是否通过t检验及DW值判断序列相关的具体阶数,方法与上面的自回归模型检验法相同。打开初始模型一,点击View工具按钮,选择res

24、idualtests右拉列表选择SerialCorrelationLMTest,在出现的对话框中选择滞后的阶数,即检验模型的resid取到滞后多少期。选择滞后一阶检验:Breusch-GodfreySerialCorrelationLMTest:F-statistic13.15036Probability0.001931Obs*R-squared8.865308Probability0.002906TestEquation:DependentVariable:RESIDMethod:LeastSquaresDate:07/29/12Time:09:51Presamplemissingvalue

25、laggedresidualssettozero.VariableCoefficientStd.Errort-StatisticProb.C-14.2447243.18361-0.3298640.7453X0.0007140.0009070.7866170.4417RESID(-1)0.7632630.2104773.6263420.0019R-squared0.422158Meandependentvar1.30E-13AdjustedR-squared0.357953S.D.dependentvar158.1566S.E.ofregression126.7275Akaikeinfocrit

26、erion12.65352Sumsquaredresid289077.4Schwarzcriterion12.80274Loglikelihood-129.8619F-statistic6.575179Durbin-Watsonstat1.159275Prob(F-statistic)0.007183说明原模型确实存在一阶序列相关性,结合该辅助回归模型的DW值为1.16,怀疑存在更高阶的序列相关。重复上述操作,引入滞后二阶检验如下:Breusch-GodfreySerialCorrelationLMTest:F-statistic20.49152Probability0.000030Obs*R

27、-squared14.84303Probability0.000598TestEquation:DependentVariable:RESIDMethod:LeastSquaresDate:07/29/12Time:09:51Presamplemissingvaluelaggedresidualssettozero.VariableCoefficientStd.Errort-StatisticProb.C14.0646332.409870.4339610.6698X-0.0006280.000742-0.8463030.4091RESID(-1)1.1084880.1761276.293696

28、0.0000RESID(-2)-0.9181750.226004-4.0626430.0008R-squared0.706811Meandependentvar1.30E-13AdjustedR-squared0.655072S.D.dependentvar158.1566S.E.ofregression92.88633Akaikeinfocriterion12.07027Sumsquaredresid146673.8Schwarzcriterion12.26923Loglikelihood-122.7379F-statistic13.66102Durbin-Watsonstat1.95026

29、3Prob(F-statistic)0.000087由于e(-2)的t检验显著,说明模型一的随机误差项确实存在二阶正序列相关性,结合该二阶自回归模型的DW值为1.95,基本确定不存在更高阶的序列相关。当然可以继续引入滞后三阶检验如下:Breusch-GodfreySerialCorrelationLMTest:F-statistic12.85743Probability0.000157Obs*R-squared14.84303Probability0.001956TestEquation:DependentVariable:RESIDMethod:LeastSquaresDate:07/29/

30、12Time:09:52Presamplemissingvaluelaggedresidualssettozero.VariableCoefficientStd.Errort-StatisticProb.C14.0646733.407340.4210050.6794X-0.0006280.000765-0.8209340.4237RESID(-1)1.1082060.2713274.0844010.0009RESID(-2)-0.9175590.499523-1.8368700.0849RESID(-3)-0.0006010.431119-0.0013950.9989R-squared0.70

31、6811Meandependentvar1.30E-13AdjustedR-squared0.633514S.D.dependentvar158.1566S.E.ofregression95.74504Akaikeinfocriterion12.16551Sumsquaredresid146673.8Schwarzcriterion12.41421Loglikelihood-122.7379F-statistic9.643071Durbin-Watsonstat1.950030Prob(F-statistic)0.000363可以看出并不存在三阶序列相关。(二)广义差分法修正1、方法原理参考教

32、材自己推导二元线性回归模型存在二阶序列相关时的广义差分模型。2、上机实现结果分析主窗口命令区域输入lsycxar(1)模型二:DependentVariable:YMethod:LeastSquaresDate:07/29/12Time:09:55Sample(adjusted):19922011Includedobservations:20afteradjustmentsConvergenceachievedafter8iterationsVariableCoefficientStd.Errort-StatisticProb.C160.0892182.89170.8753230.3936X0

33、.0214690.0030726.9889750.0000AR(1)0.7300780.2033523.5902230.0023R-squared0.964570Meandependentvar958.0450AdjustedR-squared0.960402S.D.dependentvar655.9980S.E.ofregression130.5388Akaikeinfocriterion12.71870Sumsquaredresid289686.3Schwarzcriterion12.86806Loglikelihood-124.1870F-statistic231.4107Durbin-

34、Watsonstat1.116066Prob(F-statistic)0.000000InvertedARRoots.73由于AR(1)通过t检验,说明模型一确实至少存在一阶序列相关,结合DW值为1.12,怀疑存在更高阶序列相关性。点击模型二的View工具按钮,选择residualtests右拉列表选择SerialCorrelationLMTest,LM检验结果如下:Breusch-GodfreySerialCorrelationLMTest:F-statistic6.380262Probability0.009885Obs*R-squared9.193288Probability0.0100

35、86TestEquation:DependentVariable:RESIDMethod:LeastSquaresDate:07/29/12Time:09:57Presamplemissingvaluelaggedresidualssettozero.VariableCoefficientStd.Errort-StatisticProb.C80.86347145.26430.5566650.5860X-0.0035540.002602-1.3655560.1922AR(1)-0.5728410.437314-1.3099090.2099RESID(-1)1.0291570.3395413.03

36、10220.0084RESID(-2)-0.1879230.598223-0.3141360.7577R-squared0.459664Meandependentvar-7.24E-11AdjustedR-squared0.315575S.D.dependentvar123.4773S.E.ofregression102.1528Akaikeinfocriterion12.30313Sumsquaredresid156527.8Schwarzcriterion12.55207Loglikelihood-118.0313F-statistic3.190131Durbin-Watsonstat2.021319Prob(F

展开阅读全文
相关资源
相关搜索

当前位置:首页 > 教育专区 > 高考资料

本站为文档C TO C交易模式,本站只提供存储空间、用户上传的文档直接被用户下载,本站只是中间服务平台,本站所有文档下载所得的收益归上传人(含作者)所有。本站仅对用户上传内容的表现方式做保护处理,对上载内容本身不做任何修改或编辑。若文档所含内容侵犯了您的版权或隐私,请立即通知得利文库网,我们立即给予删除!客服QQ:136780468 微信:18945177775 电话:18904686070

工信部备案号:黑ICP备15003705号-8 |  经营许可证:黑B2-20190332号 |   黑公网安备:91230400333293403D

© 2020-2023 www.deliwenku.com 得利文库. All Rights Reserved 黑龙江转换宝科技有限公司 

黑龙江省互联网违法和不良信息举报
举报电话:0468-3380021 邮箱:hgswwxb@163.com