数据分析实验报告主成分分析.docx
- 文档编号:2416248
- 上传时间:2022-10-29
- 格式:DOCX
- 页数:10
- 大小:55.01KB
数据分析实验报告主成分分析.docx
《数据分析实验报告主成分分析.docx》由会员分享,可在线阅读,更多相关《数据分析实验报告主成分分析.docx(10页珍藏版)》请在冰豆网上搜索。
数据分析实验报告主成分分析
实验八主成分分析
一、实验目的和要求
能利用原始数据与相关矩阵、协主差矩阵作主成分分析,并能理解标准化变量主成分与原始数据主成分的联系与区别;
能根据SAS输出结果选出满足要求的几个主成分.
实验要求:
编写程序,结果分析.
实验内容:
书上4.54.6
4.5dataexamp4_5;
inputidx1-x8;
cards;
18.3523.537.518.6217.4210.001.0411.21
29.2523.756.619.1917.7710.481.7210.51
38.1930.504.729.7816.287.602.5210.32
47.7329.205.429.4319.298.492.5210.00
59.4227.938.208.1416.179.421.559.76
69.1627.989.019.3215.999.101.8211.35
710.0628.6410.5210.0516.188.391.9610.81
89.0928.127.409.6217.2611.122.4912.65
99.4128.205.7710.8016.3611.561.5312.17
108.7028.127.2110.5319.4513.301.6611.96
116.9329.854.549.4916.6210.651.8813.61
128.6736.057.317.7516.6711.682.3812.88
139.9837.697.018.9416.1511.080.8311.67
146.7738.696.018.8214.7911.441.7413.23
158.1437.759.618.4913.159.761.2811.28
167.6735.718.048.3115.137.761.4113.25
177.9039.778.4912.9419.2711.052.0413.29
187.1840.917.328.9417.6012.751.1414.80
198.8233.707.5910.9818.8214.731.7810.10
206.2535.024.726.2810.037.151.9310.39
2110.6052.417.709.9812.5311.702.3114.69
227.2752.653.849.1613.0315.261.9814.57
2313.4555.855.507.459.559.522.2116.30
2410.8544.687.3214.5117.1312.081.2611.57
257.2145.797.6610.3616.5612.862.2511.69
267.6850.3711.3513.3019.2514.592.7514.87
277.7848.448.0020.5122.1215.731.1516.61
287.9439.6520.9720.8222.5212.411.757.90
298.2864.348.0022.2220.0615.120.7222.89
3012.4776.395.5211.2414.5222.005.4625.50
;
run;
proccorrcovnosimpledata=examp4_5;
varx1-x8;
run;
procprincompdata=examp4_5prefix=yout=bb;
varx1-x8;
run;
procplotdata=bb;
ploty2*y1$id='*';
procsortdata=bb;
bydescendingy1;
run;
procprintdata=bb;
varidy1y2x1-x8;
run;
输出结果:
1、样本相关系数矩阵
CorrelationMatrix
x1x2x3x4x5x6x7x8
x11.00000.3336-.0545-.0613-.28940.19880.34870.3187
x20.33361.0000-.02290.3989-.15630.71110.41360.8350
x3-.0545-.02291.00000.53330.49680.0328-.1391-.2584
x4-.06130.39890.53331.00000.69840.4679-.17130.3128
x5-.2894-.15630.49680.69841.00000.2801-.2083-.0812
x60.19880.71110.03280.46790.28011.00000.41680.7016
x70.34870.4136-.1391-.1713-.20830.41681.00000.3989
x80.31870.8350-.25840.3128-.08120.70160.39891.0000
2、调用主成分分析的princomp过程,从相关系数矩阵出发进行主成分分析,输出集bb
ThePRINCOMPProcedure
Observations30
Variables8
SimpleStatistics
x1x2x3x4
Mean8.70666666739.056000007.62900000010.86566667
StD1.61472819012.438758283.0527165403.89495579
SimpleStatistics
x5x6x7x8
Mean16.5890000011.626000001.90200000013.06100000
StD2.997854813.058108050.8515762263.64707096
1)样本相关系数矩阵R的特征值、各主成分贡献率及累计贡献率
EigenvaluesoftheCorrelationMatrix
特征值Difference贡献率%累计贡献率%
13.096288290.729065220.38700.3870
22.367223071.447235720.29590.6829已达68.29%
30.919987350.214061990.11500.7979
40.705925360.207483030.08820.8862
50.498442330.268554030.06230.9485
60.229888310.099112540.02870.9772
70.130775770.079306230.01630.9936
80.051469540.00641.0000
SAS系统14:
09Monday,October22,200122
ThePRINCOMPProcedure
2)样本相关系数矩阵R特征值的正交化特征向量
TheSASSystem17:
30Tuesday,October26,20124
ThePRINCOMPProcedure
Eigenvectors
y1y2y3y4y5y6y7y8
x10.249607-.2412380.693918-.3767700.502313-.018418-.0365430.045052
x20.519234-.037607-.071261-.224871-.4244530.001760-.2824670.642950
x3-.0184800.4754390.5778190.032379-.510472-.1733440.381416-.050854
x40.2540920.538081-.021777-.2310660.0103580.399113-.471680-.458432
x50.0216950.575449-.0480870.2853680.5162700.1461090.1591920.520977
x60.4926630.134676-.1453480.2242220.177156-.754966-.081452-.244442
x70.317147-.2606820.2863910.768116-.0907590.355165-.130720-.089297
x80.509332-.087081-.271279-.1769900.0260150.3047200.708416-.180821
3)按第一主成分对各省份进行排序
TheSASSystem17:
30Tuesday,October26,20126
Obsidy1y2x1x2x3x4x5x6x7x8
1306.89591-2.2783312.4776.395.5211.2414.5222.005.4625.50
2293.248422.560958.2864.348.0022.2220.0615.120.7222.89
3271.792142.888097.7848.448.0020.5122.1215.731.1516.61
4261.515071.373537.6850.3711.3513.3019.2514.592.7514.87
5231.40116-3.1784013.4555.855.507.459.559.522.2116.30
6211.15390-1.3742010.6052.417.709.9812.5311.702.3114.69
7221.05651-1.235247.2752.653.849.1613.0315.261.9814.57
8240.435430.4740910.8544.687.3214.5117.1312.081.2611.57
9250.153290.113207.2145.797.6610.3616.5612.862.2511.69
10170.045200.980567.9039.778.4912.9419.2711.052.0413.29
1128-0.133244.908447.9439.6520.9720.8222.5212.411.757.90
1218
- 配套讲稿:
如PPT文件的首页显示word图标,表示该PPT已包含配套word讲稿。双击word图标可打开word文档。
- 特殊限制:
部分文档作品中含有的国旗、国徽等图片,仅作为作品整体效果示例展示,禁止商用。设计者仅对作品中独创性部分享有著作权。
- 关 键 词:
- 数据 分析 实验 报告 成分
![提示](https://static.bdocx.com/images/bang_tan.gif)