应用统计方法第四章-回归分析.ppt

上传人:本田雅阁 文档编号:3049581 上传时间:2019-06-30 格式:PPT 页数:87 大小:5.34MB
返回 下载 相关 举报
应用统计方法第四章-回归分析.ppt_第1页
第1页 / 共87页
应用统计方法第四章-回归分析.ppt_第2页
第2页 / 共87页
应用统计方法第四章-回归分析.ppt_第3页
第3页 / 共87页
应用统计方法第四章-回归分析.ppt_第4页
第4页 / 共87页
应用统计方法第四章-回归分析.ppt_第5页
第5页 / 共87页
点击查看更多>>
资源描述

《应用统计方法第四章-回归分析.ppt》由会员分享,可在线阅读,更多相关《应用统计方法第四章-回归分析.ppt(87页珍藏版)》请在三一文库上搜索。

1、2019/6/30,应用统计方法第四章,1,第四章 回归分析,多元回归方法:在众多的相关的变量中,根据问题的要求,考察其中一个或几个变量与其余变量的依赖关系。 多元回归问题:如果只考察某一个变量(常称为响应变量,因变量,指标)与其余多个变量(自变量或因素)的相互依赖关系。 多因变量的多元回归问题(多对多回归),2019/6/30,应用统计方法第四章,2,例如:若某公司管理人员要预测来年该公司的销售额y时,研究认为影响销售额的因素不只是广告宣传费x1,还有个人可支配收入x2,价格x3,研究与发展费用x4,各种投资x5,销售费用x6.,2019/6/30,应用统计方法第四章,3,多元线性回归 回归

2、变量的选择与逐步回归。 可化为多元线性回归的问题,2019/6/30,应用统计方法第四章,4,第一节 多元线性回归,2019/6/30,应用统计方法第四章,5,2019/6/30,应用统计方法第四章,6,一、多元线性回归模型的基本假定 解释变量x1,x2,xm是确定性变量,不是随机变量,而且解释变量之间互不相关 随机误差项具有零均值和同方差 随机误差项在不同样本点之间是相互独立的,不存在序列相关,2019/6/30,应用统计方法第四章,7,随机误差项与解释变量之间不相关 随机误差项服从零均值,同方差的正态分布,2019/6/30,应用统计方法第四章,8,二、建立回归方程 设 令 即,2019/

3、6/30,应用统计方法第四章,9,2019/6/30,应用统计方法第四章,10,2019/6/30,应用统计方法第四章,11,2019/6/30,应用统计方法第四章,12,2019/6/30,应用统计方法第四章,13,2019/6/30,应用统计方法第四章,14,2019/6/30,应用统计方法第四章,15,2019/6/30,应用统计方法第四章,16,例2中,方差分析表为:,y,2019/6/30,应用统计方法第四章,17,2019/6/30,应用统计方法第四章,18,2019/6/30,应用统计方法第四章,19,2019/6/30,应用统计方法第四章,20,2019/6/30,应用统计方法

4、第四章,21,2019/6/30,应用统计方法第四章,22,2019/6/30,应用统计方法第四章,23,2019/6/30,应用统计方法第四章,24,2019/6/30,应用统计方法第四章,25,2019/6/30,应用统计方法第四章,26,2019/6/30,应用统计方法第四章,27,2019/6/30,应用统计方法第四章,28,2019/6/30,应用统计方法第四章,29,2019/6/30,应用统计方法第四章,30,data d411; input x1-x4 y ; cards; 7 26 6 60 78.5 1 29 15 52 74.3 11 56 8 20 104.3 11 3

5、1 8 47 87.6 7 52 6 33 95.9 11 55 9 22 109.2 3 71 17 6 102.7 1 31 22 44 72.5 2 54 18 22 93.1 21 47 4 26 115.9 1 40 23 34 83.8 11 66 9 12 113.3 10 68 8 12 109.4; proc reg data=d411 ; model y=x1-x4 ; run; quit;,2019/6/30,应用统计方法第四章,31,data d411; input x1-x4 y ; cards; 7 26 6 60 78.5 1 29 15 52 74.3 11 5

6、6 8 20 104.3 11 31 8 47 87.6 7 52 6 33 95.9 11 55 9 22 109.2 3 71 17 6 102.7 1 31 22 44 72.5 2 54 18 22 93.1 21 47 4 26 115.9 1 40 23 34 83.8 11 66 9 12 113.3 10 68 8 12 109.4 ; proc reg data=d411; model y=x1-x4 / selection=stepwise sle=0.10 sls=0.10; run; quit;,2019/6/30,应用统计方法第四章,32,The SAS System

7、 13:43 Wednesday, March 10, 2008 7 The REG Procedure Model: MODEL1 Dependent Variable: y Analysis of Variance Sum of Mean Source DF Squares Square F Value Pr F Model 4 2667.89944 666.97486 111.48 |t| Intercept 1 62.40537 70.07096 0.89 0.3991 x1 1 1.55110 0.74477 2.08 0.0708 x2 1 0.51017 0.72379 0.70

8、 0.5009 x3 1 0.10191 0.75471 0.14 0.8959 x4 1 -0.14406 0.70905 -0.20 0.8441,2019/6/30,应用统计方法第四章,33,2019/6/30,应用统计方法第四章,34,2019/6/30,应用统计方法第四章,35,data d411; input x1-x4 y ; cards; 7 26 6 60 78.5 1 29 15 52 74.3 11 56 8 20 104.3 11 31 8 47 87.6 7 52 6 33 95.9 11 55 9 22 109.2 3 71 17 6 102.7 1 31 22 4

9、4 72.5 2 54 18 22 93.1 21 47 4 26 115.9 1 40 23 34 83.8 11 66 9 12 113.3 10 68 8 12 109.4 ; proc reg data=d411; model y=x1 x2 ; run; quit;,2019/6/30,应用统计方法第四章,36,The SAS System 13:43 Wednesday, March 10, 2008 11 The REG Procedure Model: MODEL1 Dependent Variable: y Analysis of Variance Sum of Mean S

10、ource DF Squares Square F Value Pr F Model 2 2657.85859 1328.92930 229.50 |t| Intercept 1 52.57735 2.28617 23.00 .0001 x1 1 1.46831 0.12130 12.10 .0001 x2 1 0.66225 0.04585 14.44 .0001 拟合的很好,x1,x2对y的影响显著,2019/6/30,应用统计方法第四章,37,Analysis of Variance Sum of Mean Source DF Squares Square F Value Pr F Mo

11、del 1 1831.89616 1831.89616 22.80 0.0006 Error 11 883.86692 80.35154 Corrected Total 12 2715.76308 Parameter Standard Variable Estimate Error Type II SS F Value Pr F Intercept 117.56793 5.26221 40108 499.16 F Model 2 2641.00096 1320.50048 176.63 .0001 Error 10 74.76211 7.47621 Corrected Total 12 271

12、5.76308,2019/6/30,应用统计方法第四章,38,Stepwise Selection: Step 3 Variable x2 Entered: R-Square = 0.9823 and C(p) = 3.0182 Analysis of Variance Sum of Mean Source DF Squares Square F Value Pr F Model 3 2667.79035 889.26345 166.83 .000 Error 9 47.97273 5.33030 Corrected Total 12 2715.76308,2019/6/30,应用统计方法第四

13、章,39,Stepwise Selection: Step 4 Variable x4 Removed: R-Square = 0.9787 and C(p) = 2.6782 Analysis of Variance Sum of Mean Source DF Squares Square F Value Pr F Model 2 2657.85859 1328.92930 229.50 F Intercept 52.57735 2.28617 3062.60416 528.91 .0001 x1 1.46831 0.12130 848.43186 146.52 .0001 x2 0.662

14、25 0.04585 1207.78227 208.58 .0001 Bounds on condition number: 1.0551, 4.2205,2019/6/30,应用统计方法第四章,40,All variables left in the model are significant at the 0.1000 level. No other variable met the 0.1000 significance level for entry into the model. Summary of Stepwise Selection Variable Variable Numb

15、er Partial Model Step Entered Removed Vars In R-Square R-Square C(p) F Value Pr F 1 x4 1 0.6745 0.6745 138.731 22.80 0.0006 2 x1 2 0.2979 0.9725 5.4959 108.22 .0001 3 x2 3 0.0099 0.9823 3.0182 5.03 0.0517 4 x4 2 0.0037 0.9787 2.6782 1.86 0.2054,2019/6/30,应用统计方法第四章,41,三.回归变量的选择与逐步回归 (1)enter:强迫进入法 (2

16、)stepwise:逐步选择法 (3)remove:强迫消除法 (4)backward:向后剔除法 (5)forward:向前引入法,2019/6/30,应用统计方法第四章,42,2019/6/30,应用统计方法第四章,43,2019/6/30,应用统计方法第四章,44,2019/6/30,应用统计方法第四章,45,2019/6/30,应用统计方法第四章,46,2019/6/30,应用统计方法第四章,47,2019/6/30,应用统计方法第四章,48,2019/6/30,应用统计方法第四章,49,2019/6/30,应用统计方法第四章,50,2019/6/30,应用统计方法第四章,51,201

17、9/6/30,应用统计方法第四章,52,2019/6/30,应用统计方法第四章,53,2019/6/30,应用统计方法第四章,54,data d411; input x1-x4 y ; cards; 7 26 6 60 78.5 1 29 15 52 74.3 11 56 8 20 104.3 11 31 8 47 87.6 7 52 6 33 95.9 11 55 9 22 109.2 3 71 17 6 102.7 1 31 22 44 72.5 2 54 18 22 93.1 21 47 4 26 115.9 1 40 23 34 83.8 11 66 9 12 113.3 10 68

18、8 12 109.4 ; proc reg data=d411; model y=x1-x4 / selection=rsquare b adjrsq cp aic mse sbc; run; quit;,2019/6/30,应用统计方法第四章,55,The REG Procedure Model: MODEL1 Dependent Variable: y R-Square Selection Method Number in Adjusted Model R-Square R-Square C(p) AIC MSE SBC 1 0.6745 0.6450 138.7308 58.8516 8

19、0.35154 59.98154 1 0.6663 0.6359 142.4864 59.1780 82.39421 60.30789 1 0.5339 0.4916 202.5488 63.5195 115.06243 64.64937 1 0.2859 0.2210 315.1543 69.0674 176.30913 70.19730 - 2 0.9787 0.9744 2.6782 25.4200 5.79045 27.11484 2 0.9725 0.9670 5.4959 28.7417 7.47621 30.43655 2 0.9353 0.9223 22.3731 39.852

20、6 17.57380 41.54743 2 0.8470 0.8164 62.4377 51.0371 41.54427 52.73199 2 0.6801 0.6161 138.2259 60.6293 86.88801 62.32417 2 0.5482 0.4578 198.0947 65.1167 122.70721 66.81153 - 3 0.9823 0.9764 3.0182 24.9739 5.33030 27.23368 3 0.9823 0.9764 3.0413 25.0112 5.34562 27.27099 3 0.9813 0.9750 3.4968 25.727

21、6 5.64846 27.98735 3 0.9728 0.9638 7.3375 30.5759 8.20162 32.83568 - 4 0.9824 0.9736 5.0000 26.9443 5.98295 29.76903,2019/6/30,应用统计方法第四章,56,Number in -Parameter Estimates- Model R-Square Intercept x1 x2 x3 x4 1 0.6745 117.56793 . . . -0.73816 1 0.6663 57.42368 . 0.78912 . . 1 0.5339 81.47934 1.86875

22、 . . . 1 0.2859 110.20266 . . -1.25578 . - 2 0.9787 52.57735 1.46831 0.66225 . . 2 0.9725 103.09738 1.43996 . . -0.61395 2 0.9353 131.28241 . . -1.19985 -0.72460 2 0.8470 72.07467 . 0.73133 -1.00839 . 2 0.6801 94.16007 . 0.31090 . -0.45694 2 0.5482 72.34899 2.31247 . 0.49447 . - 3 0.9823 71.64831 1.

23、45194 0.41611 . -0.23654 3 0.9823 48.19363 1.69589 0.65691 0.25002 . 3 0.9813 111.68441 1.05185 . -0.41004 -0.64280 3 0.9728 203.64196 . -0.92342 -1.44797 -1.55704 - 4 0.9824 62.40537 1.55110 0.51017 0.10191 -0.14406,2019/6/30,应用统计方法第四章,57,2019/6/30,应用统计方法第四章,58,2019/6/30,应用统计方法第四章,59,2019/6/30,应用统计

24、方法第四章,60,2019/6/30,应用统计方法第四章,61,2019/6/30,应用统计方法第四章,62,2019/6/30,应用统计方法第四章,63,data d431; input year x1-x5 y1 y2; cards; 1949 0.9 0.8 0.14 6.63 0.24 1.47 7.31 1950 1.0 2.1 0.15 7.07 0.46 1.25 7.42 1951 2.9 6.3 0.33 7.60 1.02 2.05 11.13 1952 5.0 4.4 0.78 12.88 1.61 2.49 16.08 1953 8.2 13.3 1.18 15.86

25、1.63 3.16 22.86 1954 13.1 16.8 1.56 18.79 1.93 3.87 29.52 1955 23.8 17.8 2.11 14.63 2.31 4.50 34.54 1956 34.8 27.8 3.09 19.79 3.32 6.09 41.22 1957 35.4 22.1 3.58 16.50 4.44 6.78 47.54 1958 47.0 32.2 7.31 26.22 7.18 10.73 60.00 1959 62.6 33.2 9.61 28.00 8.77 17.65 78.00 1960 68.0 55.6 12.85 27.56 9.8

26、9 26.84 96.20 1961 35.3 24.4 6.76 10.95 5.58 24.20 52.37 1962 31.3 17.9 5.08 10.15 6.03 20.08 37.77 1963 35.2 24.8 5.54 14.23 7.18 19.28 40.07 1964 45.3 37.8 7.14 20.38 8.80 22.89 50.36 1965 49.5 78.8 11.20 26.56 10.45 28.94 65.33 1966 59.7 101.6 15.89 33.18 12.51 39.05 83.64 1967 47.8 74.9 10.86 23

27、.90 11.42 39.09 68.16 1968 17.7 40.2 5.10 17.56 9.03 26.81 41.64 1969 36.0 73.3 13.14 27.20 8.05 37.19 67.30 1970 62.0 138.6 25.54 36.28 10.30 54.09 103.57 1971 97.0 247.0 31.31 41.53 14.18 77.39 135.80 1972 95.2 270.0 28.79 40.24 15.19 84.02 118.10 1973 118.4 233.5 28.03 38.20 15.77 88.39 119.62 19

28、74 99.9 205.0 26.50 31.54 12.29 86.32 112.39 1975 151.0 288.0 38.61 46.87 17.36 107.94 144.41 1976 108.0 262.2 31.46 38.62 15.10 102.76 130.66 1977 162.5 358.6 46.21 52.48 20.48 118.84 175.10 1978 238.2 454.8 55.86 55.96 26.40 139.30 214.44 ; proc print; run; proc reg data=d431; model y1 y2=x1-x5; m

29、test x3,x4,x5; run; quit;,2019/6/30,应用统计方法第四章,64,The SAS System 07:49 Sunday, March 21, 2008 4 The REG Procedure Model: MODEL1 Multivariate Test 1 Multivariate Statistics and F Approximations S=2 M=0 N=10.5 Statistic Value F Value Num DF Den DF Pr F Wilks Lambda 0.17390860 10.72 6 46 .0001 Pillais T

30、race 1.08953122 9.57 6 48 .0001 Hotelling-Lawley Trace 3.23532937 12.16 6 28.955 .0001 Roys Greatest Root 2.66743672 21.34 3 24 .0001 NOTE: F Statistic for Roys Greatest Root is an upper bound. NOTE: F Statistic for Wilks Lambda is exact.,2019/6/30,应用统计方法第四章,65,data d431; input year x1-x5 y1 y2; car

31、ds; 1949 0.9 0.8 0.14 6.63 0.24 1.47 7.31 1950 1.0 2.1 0.15 7.07 0.46 1.25 7.42 1951 2.9 6.3 0.33 7.60 1.02 2.05 11.13 1952 5.0 4.4 0.78 12.88 1.61 2.49 16.08 1953 8.2 13.3 1.18 15.86 1.63 3.16 22.86 1954 13.1 16.8 1.56 18.79 1.93 3.87 29.52 1955 23.8 17.8 2.11 14.63 2.31 4.50 34.54 1956 34.8 27.8 3

32、.09 19.79 3.32 6.09 41.22 1957 35.4 22.1 3.58 16.50 4.44 6.78 47.54 1958 47.0 32.2 7.31 26.22 7.18 10.73 60.00 1959 62.6 33.2 9.61 28.00 8.77 17.65 78.00 1960 68.0 55.6 12.85 27.56 9.89 26.84 96.20 1961 35.3 24.4 6.76 10.95 5.58 24.20 52.37 1962 31.3 17.9 5.08 10.15 6.03 20.08 37.77 1963 35.2 24.8 5

33、.54 14.23 7.18 19.28 40.07 1964 45.3 37.8 7.14 20.38 8.80 22.89 50.36 1965 49.5 78.8 11.20 26.56 10.45 28.94 65.33 1966 59.7 101.6 15.89 33.18 12.51 39.05 83.64 1967 47.8 74.9 10.86 23.90 11.42 39.09 68.16 1968 17.7 40.2 5.10 17.56 9.03 26.81 41.64 1969 36.0 73.3 13.14 27.20 8.05 37.19 67.30 1970 62

34、.0 138.6 25.54 36.28 10.30 54.09 103.57 1971 97.0 247.0 31.31 41.53 14.18 77.39 135.80 1972 95.2 270.0 28.79 40.24 15.19 84.02 118.10 1973 118.4 233.5 28.03 38.20 15.77 88.39 119.62 1974 99.9 205.0 26.50 31.54 12.29 86.32 112.39 1975 151.0 288.0 38.61 46.87 17.36 107.94 144.41 1976 108.0 262.2 31.46

35、 38.62 15.10 102.76 130.66 1977 162.5 358.6 46.21 52.48 20.48 118.84 175.10 1978 238.2 454.8 55.86 55.96 26.40 139.30 214.44 ; proc print; run; proc reg data=d431; model y1 y2=x1-x5/selection=stepwise sle=0.05 sls=0.05; run; proc reg data=d431; model y1 y2=x3-x5; run; quit;,2019/6/30,应用统计方法第四章,66,Th

36、e REG Procedure Model: MODEL1 Dependent Variable: y1 Analysis of Variance Sum of Mean Source DF Squares Square F Value Pr F Model 3 46484 15495 291.53 |t| Intercept 1 8.49945 4.65024 1.83 0.0791 x3 1 2.84128 0.34248 8.30 .0001 x4 1 -0.84954 0.34357 -2.47 0.0203 x5 1 1.34764 0.70305 1.92 0.0663,2019/

37、6/30,应用统计方法第四章,67,The REG Procedure Model: MODEL1 Dependent Variable: y2 Analysis of Variance Sum of Mean Source DF Squares Square F Value Pr F Model 3 76352 25451 425.62 |t| Intercept 1 5.29311 4.93246 1.07 0.2931 x3 1 1.72533 0.36326 4.75 .0001 x4 1 1.00529 0.36442 2.76 0.0105 x5 1 1.97305 0.74572

38、 2.65 0.0136,2019/6/30,应用统计方法第四章,68,回归方程的残差分析,残差序列的正态性分析 残差序列的随机性分析 残差序列的独立性分析 奇异值诊断 异方差诊断 返回,2019/6/30,应用统计方法第四章,69,残差序列的正态性分析:,通过绘制标准化残差序列的带正态曲线的直方图或累计概率图来分析,确定残差是否接近正态 返回,2019/6/30,应用统计方法第四章,70,残差序列的随机性分析:,可以绘制残差序列和对应的预测值序列的散点图。如果残差序列是随机的,那么残差序列应与预测值序列无关,残差序列点将随机地分布在经过零的一条直线上下。 返回,2019/6/30,应用统计方

39、法第四章,71,残差序列的独立性分析:,分析残差序列是否存在后期值与前期值相关的现象。 D.W检验 返回,2019/6/30,应用统计方法第四章,72,2019/6/30,应用统计方法第四章,73,样本奇异值的诊断:,样本奇异值是样本数据中那些远离均值的样本数据点。它们会对回归方程的拟合产生较大偏差影响。 一般认为,如果某样本点对应的标准化残差的值超出了-3+3的范围,就可以判定该样本数据为奇异值。 返回,2019/6/30,应用统计方法第四章,74,异方差诊断:,线性回归模型要求残差序列服从等方差的正态分布 一般通过绘制残差序列与解释变量的散点图或计算残差与解释变量间的相关系数。 如果残差序

40、列和解释变量的平方根成正比例变化,可以对解释变量作开方处理;如果残差序列与解释变量成比例变化,可以对解释变量取对数;如果残差序列与解释变量的平方成比例的变化,可以对解释变量求倒数。 还可以用WLS(加权最小二乘)法消除异方差。 返回,2019/6/30,应用统计方法第四章,75,七、预测和控制 所谓预测就是给定解释变量x样本外的某一特征值x0=(1,x01,x02,x0p),对因变量的值y0以及E(y0)进行估计。 1、y0的点预测: 2、y0的(1-)的预测区间:,2019/6/30,应用统计方法第四章,76,第二节 可化为多元线性回归的问题,在自然科学中,y关于x 的数量关系多数都不是简单的线性关系,而是各种各样的非线性关系,于是我们常会遇到非线性回归模型,在非线性回归模型中,一种类型是可以通过变量变换化为线性模型,然后按线性模型加以解决;另一种类型的非线性模型是用任何变量变换办法都不能或不方便直接化为线性模型求得参数的估计值。,2019/6/30,应用统计方法第四章,77,多项式函数 Y=0+ 1x + 2x2+ + pxp 设i=xi 则多项式化为: Y= 0+ 1 1 + 2 2 + + p p 多元幂函数 y=x1 1 x2 2 xp p lny=

展开阅读全文
相关资源
猜你喜欢
相关搜索

当前位置:首页 > 其他


经营许可证编号:宁ICP备18001539号-1