《一组空气污染数据的主成分分析.doc》由会员分享,可在线阅读,更多相关《一组空气污染数据的主成分分析.doc(14页珍藏版)》请在三一办公上搜索。
1、一组空气污染数据的主成分分析【说明】下面的多元统计分析练习题摘自R.A. Johnson等编写的应用多元统计分析(第五版),原书为:Richard A. Johnson and Dean W. Wichern. Applied Multivariate Statistical Analysis (5th Ed). Pearson Education, Inc. 2003。我看的是中国统计出版社(China Statistics Press)2003年发行的影印本。第一题为原书第1.6题,即第1章的第6题,第二题为原书第8.12题,即第8章的第12题。第二题用的是第一题的数据。1 习题1.6.
2、The data in Table 1.5 are 42 measurements on air-pollution variables recorded at 12:00 noon in the Los Angeles area on different days.(a) Plot the marginal dot diagrams for all the variables.(b) Construct the , Sn, and R arrays, and interpret the entries in R. TABLE 1.5 AIR-POLLUTION DATAWind (x1)So
3、lar radiation (x2)CO (x3)NO (x4)NO2 (x5)O3 (x6)HC (x7)898721282710743953710343563108852815469142810389052121249847412155572642114478251111138645213946715410336914212737727418103107042117310724181039774191038764177387153164496742132396933953106253144498842763880421311453033523683511023488432763678421
4、111387921710366243983103731723871411073752411284548658436754110243103541692885419102586316122586721318277974925377952862668621114384043652Source: Data courtesy of Professor G.C. Tiao.8.12. Consider the air-pollution data listed in Table 1.5. Your job is to summarize these data in fewer than p=7 dime
5、nsions if possible. Conduct a principal component analysis of the data using both the covariance matrix S and the correlation matrix R. What have you learned? Does it make any difference which matrix is chosen for analysis? Can the data be summarized in three or fewer dimensions? Can you interpret t
6、he principal components?2 部分解答2.1 部分统计参数利用Excel计算的平均值()和标准差WindSolar radiationCONONO2O3HCAverage7.573.8571434.5476192.190476210.0476199.40476193.0952381Stdev1.581138817.3353881.23372091.08735743.37098375.56583450.6917466Excel给出的协方差矩阵SWindSolar radiationCONONO2O3HCWind2.4404762Solar radiation-2.71428
7、6293.36054CO-0.3690483.81632651.4858277NO-0.452381-1.3537410.65759641.154195NO2-0.5714296.60204082.25963721.062358311.092971O3-2.17857130.0578232.7545351-0.7913833.052154230.24093HC0.16666670.60884350.1383220.17233561.01927440.58049890.4671202Excel给出相关系数矩阵RWindSolar radiationCONONO2O3HCWind1Solar ra
8、diation-0.1014421CO-0.1938030.18279341NO-0.269543-0.0735690.50215251NO2-0.1098250.1157320.55658380.29689811O3-0.2535930.31912370.4109288-0.1339520.16664221HC0.15609790.05201040.16603230.23470430.44776780.15445061从相关系数矩阵可以看出,CO与NO、NO2相关性明显,O3与Solar radiation、CO相关性明显。后面的主成分分析将CO与NO、NO2归并到一个主成分,将O3与Sol
9、ar radiation归并到一个主成分,将HC、Wind归并到一个主成分。HC与Wind的相关系数并不高,但从正相关的角度看,二者的数值倒是最高的。方差极大正交旋转之后,HC与CO、NO、NO2归并到一个因子,因为HC与NO2的相关系数较高,与CO、NO的相关系数高于其他变量。2.2 主成分分析之一数据未经标准化下面是从相关矩阵R出发,SPSS给出的结果。原始数据未经标准化。所谓从R出发,就是在SPSS的Factor Analysis: ExtractionAnalysis选项中选中Correlation Matrix。SPSS给出的相关系数矩阵(Correlation Matrix),与E
10、xcel计算的结果一样。公因子方差(Communalities)表如下。公因子方差变化于0.5440.795之间,相差不是很大。但是,公因子方差值没有达到0.8以上的,可见每一个变量体现在三个主成分中的信息都不超过80%。特征根与方差贡献(Total Variance Explained)如下表。可见提取三个主成分可以解释原来7格变量的70.384%。主成分载荷矩阵(Component Matrix)见下表。将上表从SPSS中复制到Excel中,进行涂色分类,结果如下表所示。Component123WIND-0.362020.3278090.706084Solar radiation0.314
11、24-0.619970.24631CO0.842417-0.00803-0.12466NO0.5772430.511736-0.44671NO20.7612940.2351830.215682O30.496126-0.667490.175399HC0.4882570.3624660.593692主成分分类如下:n 第一主成分的主要相关变量:CO、NO、NO2。n 第二主成分的主要相关变量:Solar radiation、O3。n 第三主成分的主要相关变量:Wind、HC。在主成分载荷图(Component Plot)中,三个变量分别落入三个不同的主成分代表的区域。主成分得分表如下。最后一栏对几
12、个典型的样本给出了简单的解释。注意解释的时候看清主成分载荷矩阵中载荷值的正负号。Casesf1f2f3典型的说明S10.61591-0.8186-0.38418S20.03194-0.36015-0.26343S3-0.34752-0.54481-0.49701S40.2425-0.302931.80367样本4代表的区域Wind、HC污染严重S5-0.12729-0.91941-0.4042S60.72612-0.192781.21954S72.036860.899821.4607样本7和8代表的区域与CO、NO、NO2污染有明显的关系S82.573090.77732-0.34124S90.
13、09802-0.817360.30334S100.506640.788030.88735S110.39040.97744-1.48345S120.14485-0.45848-0.27016S131.924770.88883-0.66029S14-0.506620.631390.91242S15-0.89378-0.170361.19632S16-0.66037-0.398620.93758S17-0.87787-0.36350.3701S180.887331.53060.65731S19-0.429351.092530.48155S20-0.7510.924240.11384S210.4282
14、61.961331.18659样本21代表的区域Solar radiation、O3污染较小S22-0.69373-0.097470.51522S230.414840.206811.21242S24-1.162631.39047-2.12097S250.86691-1.703350.91799S26-0.91899-0.139150.18106S270.09994-0.51948-0.37202S28-1.32458-0.69110.65186S29-0.104720.39184-1.08681S30-1.85931.379330.6047S31-0.62672-0.083470.47051S
15、32-0.142640.649410.72066S330.674211.56899-2.63096样本33代表的区域Wind、HC污染较小S340.24874-1.956810.22088S35-1.714290.39216-0.08554S36-0.80238-1.13269-0.0517S37-1.00653-1.92662-1.17569样本37和38代表的区域Solar radiation、O3污染严重S381.29486-1.77265-1.32357S391.68145-1.04272-0.66334S40-0.48079-0.49683-1.07633S410.72122-0.5
16、3042-0.57934S42-1.177760.98919-1.555382.3 主成分分析之二数据未经标准化下面是从协方差矩阵S出发,SPSS给出的结果。原始数据未经标准化。所谓从S出发,就是在SPSS的Factor Analysis: ExtractionAnalysis选项中选中Covariance Matrix。公因子方差(Communalities)表如下。在未经处理的(Raw)公因子方差一栏,其Initial数值都是原始数据的方差。不过与前面Excel给出的协方差矩阵有所不同,Excel给出的是总体方差,SPSS给出的是抽样方差。例如以Wind的Initial值为例,2.4404
17、76242/41=2.5,或者2.541/42=2.4404762(对照前面的协方差矩阵)。重标的(Rescaled)结果是Extraction值与Initial值之比。公因子方差的合计结果如下:RawRescaledInitialExtractionInitialExtractionWIND2.50.030665110.012266Solar radiation300.51568300.1336710.9987288CO1.52206740.060166610.0395295NO1.18234610.006750210.0057091NO211.3635310.179005910.01575
18、27O330.9785133.845942810.1241487HC0.47851340.001667110.0034839合计348.54065304.2578671.1996188特征根与方差贡献(Total Variance Explained)如下表。在Raw一栏中显示,提取一个主成分似乎可以解释原来7格变量的87.295%。但重标之后显示的数值却是17.137%。根据公因子方差表和合计结果,重标之前,全部的方差解释为304.25786/348.54065*100=87.295%;重标之后,全部的方差解释为1.1996188/7*10017.137%。主成分载荷矩阵(Component
19、 Matrix)见下表。可以看来,由于变量Solar radiation 的方差很大,它绝对地控制了第一主成分。2.4 主成分分析之三数据经过标准化下面是从协方差矩阵S出发,SPSS给出的结果。原始数据经过标准化。可以看到所有的结果重标前后一样,并且与从相关矩阵R出发计算的结果一样。公因子方差(Communalities)表如下,重标前后的结果一样。特征根与方差贡献(Total Variance Explained)如下表。重标前后结果一样。主成分载荷矩阵(Component Matrix)见下表,重标前后一样。可以看到,第一主成分的相对重要性受到标准化的极大影响。结论自然是:如果在极其不同的
20、范围内测量变量,或者测量单位的量纲不同,变量必须经过标准化。否则,应该从相关系数矩阵出发开展主成分分析。2.5 因子分析方差极大旋转数据经过标准化,从任意矩阵出发,在因子分析中进行方差极大旋转(Varimax),载荷矩阵如下。载荷矩阵和因子分类结果如下表。Component公因子方差123WIND-0.028414-0.1736280.84030730.7370703Solar radiation0.04301990.7359707-0.0167460.543784CO0.70539950.27462-0.3902130.7252709NO0.6450475-0.38278-0.4816890
21、.7946307NO20.81138640.15177760.00379670.6813987O30.16603120.8196628-0.1517720.7224481HC0.70546980.07125040.46848940.7222466方差贡献2.09993471.49369621.3332183可以看到,旋转之后三个因子的方差贡献差别缩小了。2.6 回答问题n What have you learned? n Does it make any difference which matrix is chosen for analysis? n Can the data be summarized in three or fewer dimensions? n Can you interpret the principal components?