icysand
程序:
data Wastes;
input City$ ISG HW ISU ISD RISU@@;
cards;
Beijing 1238 10.58 969 91403 67.9
Tianjin 1123 14.96 1153 44 98.3
Shijiazhuang 852 14.45 782 1590 91.8
Taiyuan 2084 2.75 936 509519 44.6
Hohhot 257 2.94 122 465 36.1
Shenyang 475 2.33 330 11136 69.3
Changchun 303 1.88 300 . 98.9
Harbin 946 1.22 705 . 74.5
hanghai 1964 48.77 1892 1233 96.3
Nanjing 1159 21.33 1052 . 87.9
Hangzhou 461 3.53 436 3994 93.9
Hefei 188 1.55 186 22 98.8
Fuzhou 136 0.93 126 112 92.6
Nanchang 154 0.37 135 2343 88.1
Jinan 874 9.19 846 240 94.7
Zhengzhou 691 0.23 467 . 67.6
Wuhan 847 0.73 770 8160 85.4
Changsha 110 . 98 56726 88.1
Guangzhou 540 22.49 520 2485 91.2
Nanning 304 25.26 245 52109 80.5
Haikou 4 0.09 3 268 94.5
Chongqing 1777 13.08 1329 1844955 72.1
Chengdu 424 0.22 401 124830 94.5
Guiyang 657 155.71 290 69613 43.7
Kunming 1132 0.41 451 316990 39.4
Lhasa . . . . .
Xian 125 0.17 117 3407 88.1
Lanzhou 161 11.10 193 2929 96.9
Xining 184 0.45 95 900 48.7
Yinchuan 67 . 63 7087 94.8
Urumqi 343 3.68 247 3286 68.5
;
run;
proc princomp n=5 out=out1;
var ISG HW ISU ISD RISU;
run;
proc princomp n=5 out=out2 std;
var ISG HW ISU ISD RISU;
run;
proc print data=out1;
var prin1-prin5;
run;
proc print data=out2;
var prin1-prin5;
run;
问题:
出现的几个WARNING
WARNING: Variable Prin1 has the same name as one of the components. The values in Prin1 will be the component's scores.
WARNING: Variable Prin2 has the same name as one of the components. The values in Prin2 will be the component's scores.
WARNING: Variable Prin3 has the same name as one of the components. The values in Prin3 will be the component's scores.
WARNING: Variable Prin4 has the same name as one of the components. The values in Prin4 will be the component's scores.
WARNING: Variable Prin5 has the same name as one of the components. The values in Prin5 will be the component's scores.
WARNING: 7 of 31 observations in data set WORK.OUT1 omitted due to missing values.
在原始数据中有几个空白数据我在程序中用“.”(不包含双引号)代替了,结果输出结果变成了只要有空白数据的那行全都变成了“.”。具体情况在下面数据:
SAS 系统 16:36 Wednesday, June 26, 2002 40
Obs Prin1 Prin2 Prin3 Prin4 Prin5
1 0.75558 0.03937 0.06695 -1.17411 -0.49277
2 0.62569 1.06544 0.99160 -0.49843 -0.67650
3 0.16650 0.61947 0.60889 -0.23930 0.04542
4 1.72954 -0.56350 -1.10150 -1.48044 3.20388
5 -0.56107 -1.45678 -1.18427 -1.16682 -2.05332
6 -0.38894 -0.22040 -0.41884 -0.48749 -0.30643
7 . . . . .
8 . . . . .
9 1.92863 0.96454 2.21827 -1.10314 -0.95001
10 . . . . .
11 -0.42875 0.62581 0.16474 0.16693 0.28622
12 -0.85329 0.64711 0.05279 0.63699 0.76000
13 -0.91116 0.41451 -0.12306 0.52588 0.51691
14 -0.87051 0.28314 -0.22075 0.37214 0.28776
15 0.20205 0.83844 0.58855 -0.30781 -0.15711
16 . . . . .
17 0.14369 0.62314 0.15573 -0.62923 -0.36252
18 . . . . .
19 -0.23288 0.28873 0.59868 0.29144 0.09604
20 -0.52168 -0.29105 0.20109 0.52091 0.04156
21 -1.11395 0.40621 -0.18790 0.74847 0.73297
22 2.79828 0.28948 -1.95238 2.99773 -1.08376
23 -0.40069 0.66752 -0.08822 0.49974 0.23438
24 0.36820 -3.53657 2.45787 1.42482 0.45387
25 0.53984 -1.05487 -1.35132 -1.14677 0.80022
26 . . . . .
27 -0.90504 0.27312 -0.23961 0.40528 0.24160
28 -0.82420 0.43268 0.22970 0.76724 0.48124
29 -0.69991 -1.02715 -1.01455 -0.76965 -1.56761
30 . . . . .
31 -0.54595 -0.32841 -0.45245 -0.35439 -0.53203
怎么回事```高手解答一下
icysand
是做主成分分析
sasiml
主成分要考虑同一元组的所有变量,若果有缺失值,出现上述情况也是正常的,供参考,呵呵
icysand
那几个WARNING是什么意思呢?特别是WARNING: 7 of 31 observations in data set WORK.OUT1 omitted due to missing values.
neige
nothing wrong, u have missing values in your original dataset
icysand
[quote]引用第4楼neige于2007-06-26 20:35发表的“”:
nothing wrong, u have missing values in your original dataset[/quote]
不太明白,程序本身没有问题吗?那那个WARNING是什么意思?