资源描述
单击此处编辑母版标题样式,单击此处编辑母版文本样式,第二级,第三级,第四级,第五级,*,主成分回归分析方法,冯跃华,参考,sas,统计分析与应用,从入门到精通,,汪海波等,1,、主成分分析除减少自变量的个数外,主成分分析可以用来解决自变量共线性的问题。,2,、线性回归分析要求自变量是相互独立的,但是在实际应用中,经常会遇到自变量相关的问题。,好的可行的方法:借助于主成分分析,用主成分回归求回归系数。即先用主成分分析法计算出主成分表达式和主成分得分变量,而主成分得分变量是相互独立的,因此可以将因变量对主成分得分变量回归,然后将主成分的表达式代回到回归模型中,即可得到标准化自变量与因变量的回归模型,最后将标准化自变量转为原始自变量。,具体步骤:,1,、用主成分分析法计算出主成分表达式和主成分得分变量(将贡献小的主成分舍去),即求得,Z=WX,。,2,、用回归分析法将因变量对主成分得分变量进行回归,得到因变量关于主成分得分变量的回归模型,即求得,y=AZ,。,3,、将主成分的表达式代回到回归模型中,即可得到标准化自变量与因变量的回归模型,即得到,y=AZ=A(WX)=BX,4,、将标准化自变量转换为原始自变量,即可得到原始自变量与因变量的回归模型。,例:某学校,20,名一年级女大学生体重(公斤)、胸围(厘米)、肩宽(厘米)及肺活量(升)实测值如表所示,试对影响女大学生肺活量的有关因素作多元回归分析。,编号,体重(公斤),胸围(厘米),肩宽(厘米),肺活量(升),1,51.3,73.6,36.4,2.99,2,48.9,83.9,34,3.11,3,42.8,78.3,31,1.91,4,55,77.1,31,2.63,5,45.3,81.7,30,2.86,6,45.3,74.8,32,1.91,7,51.4,73.7,36.5,2.98,8,53.8,79.4,37,3.28,9,49,72.6,30.1,2.52,10,53.9,79.5,37.1,3.27,11,48.8,83.8,33.9,3.1,12,52.6,88.4,38,3.28,13,42.7,78.2,30.9,1.92,14,52.5,88.3,38.1,3.27,15,55.1,77.2,31.1,2.64,16,45.2,81.6,30.2,2.85,17,51.4,78.3,36.5,3.16,18,48.7,72.5,30,2.51,19,51.3,78.2,36.4,3.15,20,45.2,74.7,32.1,1.92,核心程序:,例,16-2_1.sas,DM,log;clear;output;clear,;,ods,rtf file=D:sas200312.3.rtf;,PROC,IMPORT,OUT=exm16_2,DATAFILE=D:sas2003exm16_2.xls,DBMS=EXCEL2000 REPLACE;,SHEET=Sheet1;,GETNAMES=YES;,RUN,;,proc,reg,data=exm16_2;,model y=x1 x2 x3/tol,vif,collin,;,proc,princomp,data=exm16_2 out=out1 prefix=z;,var,x1-x3;,run,;,proc,print,data=out1;,title output:out1;,proc,reg,data=out1;,model y=z1 z2/stb;,run,;,quit,;,ods,rtf close;,核心结果:,Parameter Estimates,Variable,Label,DF,ParameterEstimate,StandardError,tValue,Pr|t|,Tolerance,VarianceInflation,Intercept,Intercept,1,-4.71489,1.30082,-3.62,0.0023,.,0,x1,x1,1,0.06091,0.02050,2.97,0.0090,0.65229,1.53305,x2,x2,1,0.03563,0.01531,2.33,0.0334,0.82477,1.21245,x3,x3,1,0.04924,0.02866,1.72,0.1051,0.55760,1.79340,Collinearity,Diagnostics,Number,Eigenvalue,ConditionIndex,Proportion of Variation,Intercept,x1,x2,x3,1,3.99037,1.00000,0.00015078,0.00024594,0.00017472,0.00027254,2,0.00501,28.21596,0.09477,0.18137,0.16968,0.23098,3,0.00329,34.80401,0.06637,0.48355,0.07204,0.55264,4,0.00132,54.90612,0.83872,0.33484,0.75811,0.21611,Eigenvalues,of the Correlation Matrix,Eigenvalue,Difference,Proportion,Cumulative,1,1.76317163,0.87824382,0.5877,0.5877,2,0.88492781,0.53302725,0.2950,0.8827,3,0.35190056,0.1173,1.0000,Eigenvectors,z1,z2,z3,x1,x1,0.585003,-.556580,0.589907,x2,x2,0.447445,0.828133,0.337621,x3,x3,0.676435,-.066442,-.733500,三亚租车 http:/ Estimates,Variable,Label,DF,ParameterEstimate,StandardError,tValue,Pr|t|,StandardizedEstimate,Intercept,Intercept,1,2.76300,0.06312,43.78,.0001,0,z1,1,0.31778,0.04877,6.52,.0001,0.84500,z2,1,-0.00510,0.06884,-0.07,0.9419,-0.00960,
展开阅读全文