应用统计方法第四章-回归分析.ppt
第四章 回归分析多元回归方法:在众多的相关的变量中,根据问题的要求,考察其中一个或几个变量与其余变量的依赖关系。多元回归问题:如果只考察某一个变量(常称为响应变量,因变量,指标)与其余多个变量(自变量或因素)的相互依赖关系。多因变量的多元回归问题(多对多回归)2/16/20231应用统计方法第四章例如:若某公司管理人员要预测来年该公司的销售额y时,研究认为影响销售额的因素不只是广告宣传费x1,还有个人可支配收入x2,价格x3,研究与发展费用x4,各种投资x5,销售费用x6.2/16/20232应用统计方法第四章 多元线性回归回归变量的选择与逐步回归。可化为多元线性回归的问题2/16/20233应用统计方法第四章第一节 多元线性回归2/16/20234应用统计方法第四章2/16/20235应用统计方法第四章一、多元线性回归模型的基本假定解释变量x1,x2,xm是确定性变量,不是随机变量,而且解释变量之间互不相关随机误差项具有零均值和同方差 随机误差项在不同样本点之间是相互独立的,不存在序列相关 2/16/20236应用统计方法第四章随机误差项与解释变量之间不相关 随机误差项服从零均值,同方差的正态分布 2/16/20237应用统计方法第四章二、建立回归方程设令 即2/16/20238应用统计方法第四章2/16/20239应用统计方法第四章2/16/202310应用统计方法第四章2/16/202311应用统计方法第四章2/16/202312应用统计方法第四章2/16/202313应用统计方法第四章2/16/202314应用统计方法第四章2/16/202315应用统计方法第四章例2中,方差分析表为:y2/16/202316应用统计方法第四章2/16/202317应用统计方法第四章2/16/202318应用统计方法第四章2/16/202319应用统计方法第四章2/16/202320应用统计方法第四章2/16/202321应用统计方法第四章2/16/202322应用统计方法第四章2/16/202323应用统计方法第四章2/16/202324应用统计方法第四章2/16/202325应用统计方法第四章2/16/202326应用统计方法第四章2/16/202327应用统计方法第四章2/16/202328应用统计方法第四章2/16/202329应用统计方法第四章data d411;input x1-x4 y;cards;7 26 6 60 78.51 29 15 52 74.311 56 8 20 104.311 31 8 47 87.67 52 6 33 95.911 55 9 22 109.23 71 17 6 102.71 31 22 44 72.52 54 18 22 93.121 47 4 26 115.91 40 23 34 83.811 66 9 12 113.310 68 8 12 109.4;proc reg data=d411;model y=x1-x4;run;quit;2/16/202330应用统计方法第四章data d411;input x1-x4 y;cards;7 26 6 60 78.51 29 15 52 74.311 56 8 20 104.311 31 8 47 87.67 52 6 33 95.911 55 9 22 109.23 71 17 6 102.71 31 22 44 72.52 54 18 22 93.121 47 4 26 115.91 40 23 34 83.811 66 9 12 113.310 68 8 12 109.4;proc reg data=d411;model y=x1-x4/selection=stepwise sle=0.10 sls=0.10;run;quit;2/16/202331应用统计方法第四章 The SAS System 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 0.5009 x3 1 0.10191 0.75471 0.14 0.8959 x4 1 -0.14406 0.70905 -0.20 0.84412/16/202332应用统计方法第四章2/16/202333应用统计方法第四章2/16/202334应用统计方法第四章data d411;input x1-x4 y;cards;7 26 6 60 78.51 29 15 52 74.311 56 8 20 104.311 31 8 47 87.67 52 6 33 95.911 55 9 22 109.23 71 17 6 102.71 31 22 44 72.52 54 18 22 93.121 47 4 26 115.91 40 23 34 83.811 66 9 12 113.310 68 8 12 109.4;proc reg data=d411;model y=x1 x2;run;quit;2/16/202335应用统计方法第四章 The SAS System 13:43 Wednesday,March 10,2008 11 The REG Procedure Model:MODEL1 Dependent Variable:y Analysis of Variance Sum of Mean Source 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 F Model 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 FModel 3 2667.79035 889.26345 166.83 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.66225 0.04585 1207.78227 208.58 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 F Wilks Lambda 0.17390860 10.72 6 46 .0001 Pillais Trace 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 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 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 =2 or abs(d)4/10;run;proc print data=r41;id n;var y d stu;run;*4-1(4);data da41;set data41;x3=x1*x1;x4=x1*x2;x5=x2*x2;run;proc print;run;proc reg data=da41;model y=x1-x5/selection=stepwise sle=0.10 sls=0.10;run;quit;2/16/202386应用统计方法第四章data data43;input x1 x2 y;n=_n_;cards;1.5 5.0 962.0 2.0 901.5 4.0 952.5 2.5 923.3 3.0 952.3 3.5 954.2 2.5 942.5 3.0 943.5 2.0 .;proc print;run;*4-3(1)+(2)+(3)+(4);proc reg data=data43;model y=x1 x2/r;output out=o43 cookd=d student=stu;run;*4-3(2);data r43(keep=n y d stu);set o43;if abs(stu)=2 or abs(d)4/8;run;proc print data=r43;id n;var y d stu;run;2/16/202387应用统计方法第四章