程序代写代做 实训结果及分析

实训结果及分析
运行源程序得到如下结果并进行分析。
5.1聚类分析
#### 预览数据
名称 涨幅 现价 涨跌 涨速 换手 今开 最高 最低
1 宜华健康 -3.69 4.70 -0.18 0.21 8.26 4.70 4.83 4.57
2 国新健康 -0.13 15.27 -0.02 -0.45 3.39 15.20 16.30 15.11
3 国际医学 0.84 4.83 0.04 -0.40 1.63 4.81 4.96 4.77
4 贝瑞基因 -0.82 48.40 -0.40 -0.32 4.85 48.00 51.40 47.10
5 科华生物 4.91 14.97 0.70 0.07 6.90 14.28 15.45 14.27
6 美年健康 -0.94 13.67 -0.13 0.22 0.58 13.81 13.94 13.55
#### 预览数据
涨幅 现价 涨跌 涨速 换手 今开 最高 最低
宜华健康 -3.69 4.70 -0.18 0.21 8.26 4.70 4.83 4.57
国新健康 -0.13 15.27 -0.02 -0.45 3.39 15.20 16.30 15.11
国际医学 0.84 4.83 0.04 -0.40 1.63 4.81 4.96 4.77
贝瑞基因 -0.82 48.40 -0.40 -0.32 4.85 48.00 51.40 47.10
科华生物 4.91 14.97 0.70 0.07 6.90 14.28 15.45 14.27
美年健康 -0.94 13.67 -0.13 0.22 0.58 13.81 13.94 13.55
#### 画出最短距离法下的矩形框
INCLUDEPICTURE “C:\\Users\\Lenovo\\Documents\\Tencent Files\\2874916914\\Image\\C2C\\SZEGY@JQR6SR$WW$H3K[Q]A.png” \* MERGEFORMATINET
#### 画出最长距离法下的矩形框
INCLUDEPICTURE “C:\\Users\\Lenovo\\AppData\\Roaming\\Tencent\\Users\\2874916914\\QQ\\WinTemp\\RichOle\\XC4Q0W(`T9$7)B@RORUFW]F.png” \* MERGEFORMATINET
#### 画出中间值距离法下的矩形框
INCLUDEPICTURE “C:\\Users\\Lenovo\\Documents\\Tencent Files\\2874916914\\Image\\C2C\\~0(PA($UX@U`I$1ME23IK55.png” \* MERGEFORMATINET
#### 画出类平均法下的矩形框
INCLUDEPICTURE “C:\\Users\\Lenovo\\Documents\\Tencent Files\\2874916914\\Image\\C2C\\8SZV_QTFW9Y961`GX@M5X9K.png” \* MERGEFORMATINET
#### 画出ward法下的矩形框
INCLUDEPICTURE “C:\\Users\\Lenovo\\Documents\\Tencent Files\\2874916914\\Image\\C2C\\F}@ZIZZ%BK[4K}O[X$S~1VX.png” \* MERGEFORMATINET
对于各种距离方法下的矩形框进行分析,可以看出不同距离方法的分类结果有所差异,但大体的结果是一致的。

5.2主成分分析
####作主成分分析,并显示分析结果如下
Importance of components:
Comp.1 Comp.2 Comp.3 Comp.4 Comp.5 Comp.6 Comp.7 Comp.8
Standard deviation 2.1916499 1.2307233 0.9878526 0.67738326 0.49688867 1.704547e-02 8.157851e-03 5.869261e-03
Proportion of Variance 0.6004162 0.1893350 0.1219816 0.05735601 0.03086229 3.631851e-05 8.318817e-06 4.306028e-06
Cumulative Proportion 0.6004162 0.7897512 0.9117328 0.96908876 0.99995106 9.999874e-01 9.999957e-01 1.000000e+00

Loadings:
Comp.1 Comp.2 Comp.3 Comp.4 Comp.5 Comp.6 Comp.7 Comp.8
x1 0.243 0.582 0.154 0.415 0.637
x2 -0.439 0.208 0.107 -0.245 0.823
x3 0.357 0.260 0.237 0.461 -0.732
x4 0.106 0.135 -0.958 0.217
x5 0.155 0.647 -0.727 -0.166
x6 -0.443 0.188 0.516 -0.695
x7 -0.440 0.203 -0.695 -0.506
x8
#### 相关系数矩阵
x1 x2 x3 x4 x5 x6 x7 x8
x1 1.0000000 -0.3223539 0.65500962 0.12813310 0.5803711 -0.3423742 -0.3284759 -0.3387664
x2 -0.3223539 1.0000000 -0.62874182 -0.17869592 -0.1550243 0.9993005 0.9998348 0.9996322
x3 0.6550096 -0.6287418 1.00000000 0.07226619 0.3869076 -0.6540568 -0.6395891 -0.6444304
x4 0.1281331 -0.1786959 0.07226619 1.00000000 0.1821321 -0.1799023 -0.1772040 -0.1819235
x5 0.5803711 -0.1550243 0.38690762 0.18213206 1.0000000 -0.1743262 -0.1576795 -0.1722050
x6 -0.3423742 0.9993005 -0.65405676 -0.17990232 -0.1743262 1.0000000 0.9995338 0.9998409
x7 -0.3284759 0.9998348 -0.63958905 -0.17720399 -0.1576795 0.9995338 1.0000000 0.9996745
x8 -0.3387664 0.9996322 -0.64443035 -0.18192348 -0.1722050 0.9998409 0.9996745 1.0000000
#### 求特征值与特征向量并输出特征值
4.803329e+00 1.514680e+00 9.758528e-01 4.588481e-01 2.468983e-01 2.905481e-04 6.655054e-05 3.444822e-05
#### 求前四个主成分的累计方差贡献率
0.9690888
#### 输出前四个主成分的荷载矩阵
Comp.1 Comp.2 Comp.3 Comp.4
x1 0.2432049 0.5822867 0.153673047 0.41517843
x2 -0.4391734 0.2083943 0.011539752 0.10730352
x3 0.3573094 0.2600279 0.236596684 0.46112994
x4 0.1056305 0.1345428 -0.958229501 0.21705245
x5 0.1549735 0.6468198 -0.043874107 -0.72656976
x6 -0.4427116 0.1879790 0.004296557 0.09370412
x7 -0.4403685 0.2032111 0.006600748 0.09582620
x8 -0.4418320 0.1918097 0.009093570 0.10243774
#### 画出主成分的碎石图
INCLUDEPICTURE “C:\\Users\\Lenovo\\Documents\\Tencent Files\\2874916914\\Image\\C2C\\ZFN$I{$MJ@X9~(AU]_`O(LW.png” \* MERGEFORMATINET
#### 画出主成分的散点图
INCLUDEPICTURE “C:\\Users\\Lenovo\\Documents\\Tencent Files\\2874916914\\Image\\C2C\\(KVIWY4Z__DE5$NA0K3JIBW.png” \* MERGEFORMATINET
#### 输出前四个主成分的综合得分信息
Comp.1 Comp.2 Comp.3 Comp.4 scores
[1,] 1.225856978 -0.96539334 -0.784800150 -0.917637119 0.41779297
[2,] 0.729909253 -0.95028795 0.976662790 -0.241883607 0.37518544
[3,] 1.207920983 -1.16118304 0.904721803 -0.008634070 0.63489226
[4,] -0.687374459 -0.29511588 0.608717785 -0.184835505 -0.41785189
[5,] 1.409076781 0.35545780 -0.008704531 0.319473384 0.96027842
[6,] 0.842444316 -1.16319055 -0.643561642 0.306962759 0.23185496
[7,] 1.198253627 -1.24850672 1.184344716 -0.222127138 0.63440301
[8,] 1.189859592 -1.25846086 -0.922354013 0.206018737 0.38742221
[9,] 0.156122433 -0.50832101 -0.379953659 -0.019677861 -0.05157474
[10,] 1.834471013 1.66717678 -1.785211312 0.533732610 1.26918281
[11,] 2.482921040 3.02549518 -0.919318519 -0.924870653 1.95898587
[12,] 1.156657684 -0.82374151 -0.076852927 -0.027355101 0.54439730
[13,] 2.292371165 2.61507908 0.280687513 -0.946484193 1.91051109
[14,] 1.348949188 0.69181781 1.171471516 -1.270502356 1.04318953
[15,] -2.576007046 -0.85273292 0.424511263 -1.062102227 -1.77203982
[16,] -0.455402823 -0.79042984 0.003503895 -0.364023919 -0.45768644
[17,] -0.493621654 0.14095029 -1.947806610 -1.284852938 -0.59951393
[18,] -0.102783390 -0.38960491 -0.379948343 0.611471497 -0.15143482
[19,] -0.641954427 -0.91046224 -0.018517885 0.186716378 -0.56689513
[20,] 2.146109988 2.10755165 -3.038135348 -0.731911718 1.31568574
[21,] 1.508866567 -0.16129805 -0.465477195 0.426555607 0.86998679
[22,] 1.027578000 -1.18336880 -0.070885337 0.297561911 0.41414331
[23,] 0.567079807 -1.31808334 0.082816100 -0.046831954 0.10147736
[24,] 0.733735965 -1.57335593 1.940825996 -0.654053203 0.35279207
[25,] 1.395828654 0.64930169 3.739905232 -0.387244856 1.43949912
[26,] 1.645704157 1.15812494 0.510420554 1.305636607 1.38741572
[27,] 0.401291198 -0.74783884 0.018046606 0.336074355 0.12468097
[28,] 1.760342505 1.39854614 0.478364458 0.950099564 1.48033643
[29,] 2.184624338 1.20226001 0.250869647 0.063504580 1.62374964
[30,] 1.265785317 -0.60809323 1.456467877 -0.573977649 0.81479212
[31,] 1.229704324 0.02196634 1.112620567 0.604790845 0.94202001
[32,] 1.214270293 -0.36245014 0.190314930 -0.033654916 0.70347288
[33,] 1.082004397 -1.53890163 -0.183536580 -0.109137789 0.34015178
[34,] 0.443448567 -0.98187363 -1.100326354 0.022879846 -0.05423299
[35,] -2.095732676 -0.30116865 0.051715093 0.351371551 -1.32998345
[36,] 0.979133785 -1.30932238 -0.179605451 -0.174525442 0.31789515
[37,] 0.940310891 -0.26066408 -0.823092992 0.786303423 0.47459232
[38,] 1.579992809 0.97254532 0.539770695 1.584422807 1.33064009
[39,] 1.389862845 -0.23891172 0.586633384 -0.228029130 0.87478204
[40,] 1.468312886 0.23733647 -1.820084738 0.764209533 0.77222037
[41,] 2.326732370 2.84843805 0.273935002 -1.166587029 1.96351566
[42,] -0.009036585 -0.90637347 -0.574302304 0.146775796 -0.24628264
[43,] -3.319131349 -0.48700281 -0.501488228 -0.215054463 -2.22742636
[44,] 0.402266979 -1.18353265 -0.027460059 -0.471769029 -0.01337847
[45,] -1.484371035 -0.81050375 -1.617427832 0.005924621 -1.28125902
[46,] -0.035936368 -1.08065025 0.158630988 -0.144542157 -0.22198375
[47,] -0.041555965 -1.14588945 0.145572885 -0.160223802 -0.24078331
[48,] -0.868779334 -0.52123854 0.403826159 -0.273544567 -0.60546355
[49,] -2.568618031 -0.43971848 -0.963337674 -0.191953545 -1.80996123
[50,] -1.598032574 0.71675729 0.057325105 0.818451150 -0.79439752
[51,] 1.069617231 2.71927631 0.715416758 1.451048398 1.36990921
[52,] -0.622400422 -0.73227417 0.166828191 -0.275481473 -0.52399219
[53,] -11.294245050 1.39322618 -0.714533858 -0.574847591 -6.84931279
[54,] -0.790242777 -0.27231255 -0.458365264 0.271386978 -0.58444522
[55,] -1.126276310 1.20572298 0.571127159 -1.760617251 -0.49455117
[56,] 0.924810043 -0.71219813 0.239502016 0.045714637 0.46668971
[57,] 1.273213576 -1.10995607 -0.053745205 0.239808348 0.57941345
[58,] -0.299790225 -1.09372859 -0.379156732 0.134637844 -0.43918353
[59,] 1.386895445 -0.97702863 -0.017307317 0.309162918 0.68450899
[60,] 0.954553628 -0.28123080 -0.493399067 0.283746725 0.49115377
[61,] -3.349400586 0.48913202 0.108668366 0.856707443 -1.91523392
[62,] 1.166660231 -1.42012819 0.451354848 0.056229472 0.50550978
[63,] 2.023289172 0.79854651 0.325838682 0.741371836 1.49447280
[64,] -1.528411406 0.47225763 0.217201459 0.764696662 -0.78208887
[65,] 1.826066641 4.76946547 0.630168500 -1.112374419 2.07668714
[66,] 1.169749840 0.01942860 -0.455374971 0.435713902 0.69700395
[67,] 0.108984481 -1.03437752 -0.249884062 0.250078724 -0.15121992
[68,] -4.796369665 -0.07419043 1.396540604 -0.061103081 -2.81400147
[69,] 1.322516758 1.31114229 -0.107070477 -1.710164784 0.96085801
[70,] -1.054361682 -0.19137357 0.522459803 0.446445747 -0.59845158
[71,] 0.794658700 -0.61440544 -0.131211725 -0.287401711 0.33877999
[72,] 1.998070307 1.01776878 -2.978322819 1.171523721 1.13123418
[73,] -5.517886400 1.78408953 1.173962298 1.261542681 -2.84770501
[74,] -7.983401469 1.05004828 -1.235057896 -0.225267725 -4.90989844
[75,] -0.941839005 0.38242050 -0.149626800 -0.352269420 -0.54850114
[76,] 0.531920239 -1.06332532 -0.557288712 -0.585036351 0.01704131
[77,] -0.129097154 -0.23097286 -0.247983284 -0.060162327 -0.15988559
[78,] -0.796566068 -0.61561582 0.223669749 -0.011371559 -0.58632132
[79,] -0.747400895 2.11725275 2.042489910 1.412173796 0.29126457
[80,] -0.064854245 -0.71430807 -0.382149479 -0.260684627 -0.24326984
[81,] -2.158095205 -0.17434489 1.565967381 0.001894353 -1.17392448
[82,] 0.489955902 -0.61956255 0.081130744 -0.731240751 0.14944761
[83,] -1.629786607 1.07042153 -0.142341682 0.283229260 -0.80178435
结合主成分累计方差贡献度以及碎石图可以看出,前四个指标波动幅度较大。这说明它们携带的信息较多,而前四个指标以后波动幅度明显减缓。而且前四个指标的累计方差贡献率大于95%,故可以判断前四个指标对于整个数据影响较大,后面的指标对于数据的影响较小,可以在一些情况下不予考虑。
因此对于整个医疗保健股市数据,可以发现对于涨幅、现价、涨跌、涨速、换手、今开、最高和最低八个指标下,前四个因素对于股市数据的影响较大,在对于股票进行选择时需要重点考虑。

PAGE 1

PAGE 2