程序(对数据做主成分分析):
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;
日志:
622 data Wastes;
623 input City$ ISG HW ISU ISD RISU@@;
624 cards;
NOTE: INPUT 语句到达了行的末尾后,SAS 进入了新的一行。
NOTE: 数据集 WORK.WASTES 有 31 个观测和 6 个变量。
NOTE: DATA 语句 所用时间(总处理时间):
实际时间 0.01 秒
CPU 时间 0.00 秒
656 run;
657 proc princomp n=5 out=out1;
658 var ISG HW ISU ISD RISU;
659 run;
WARNING: 7 of 31 observations in data set WORK.WASTES omitted due to missing values.
NOTE: 数据集 WORK.OUT1 有 31 个观测和 11 个变量。
NOTE: PROCEDURE PRINCOMP 所用时间(总处理时间):
实际时间 0.03 秒
CPU 时间 0.03 秒
660 proc princomp n=5 out=out2 std;
661 var ISG HW ISU ISD RISU;
662 run;
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.
NOTE: 数据集 WORK.OUT2 有 31 个观测和 11 个变量。
NOTE: PROCEDURE PRINCOMP 所用时间(总处理时间):
实际时间 0.03 秒
CPU 时间 0.03 秒
663 proc print data=out1;
664 var prin1-prin5;
665 run;
NOTE: 从数据集 WORK.OUT1 读取了 31 个观测。
NOTE: PROCEDURE PRINT 所用时间(总处理时间):
实际时间 0.00 秒
CPU 时间 0.00 秒
666 proc print data=out2;
667 var prin1-prin5;
668 run;
NOTE: 从数据集 WORK.OUT2 读取了 31 个观测。
NOTE: PROCEDURE PRINT 所用时间(总处理时间):
实际时间 0.00 秒
CPU 时间 0.00 秒
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;
日志:
622 data Wastes;
623 input City$ ISG HW ISU ISD RISU@@;
624 cards;
NOTE: INPUT 语句到达了行的末尾后,SAS 进入了新的一行。
NOTE: 数据集 WORK.WASTES 有 31 个观测和 6 个变量。
NOTE: DATA 语句 所用时间(总处理时间):
实际时间 0.01 秒
CPU 时间 0.00 秒
656 run;
657 proc princomp n=5 out=out1;
658 var ISG HW ISU ISD RISU;
659 run;
WARNING: 7 of 31 observations in data set WORK.WASTES omitted due to missing values.
NOTE: 数据集 WORK.OUT1 有 31 个观测和 11 个变量。
NOTE: PROCEDURE PRINCOMP 所用时间(总处理时间):
实际时间 0.03 秒
CPU 时间 0.03 秒
660 proc princomp n=5 out=out2 std;
661 var ISG HW ISU ISD RISU;
662 run;
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.
NOTE: 数据集 WORK.OUT2 有 31 个观测和 11 个变量。
NOTE: PROCEDURE PRINCOMP 所用时间(总处理时间):
实际时间 0.03 秒
CPU 时间 0.03 秒
663 proc print data=out1;
664 var prin1-prin5;
665 run;
NOTE: 从数据集 WORK.OUT1 读取了 31 个观测。
NOTE: PROCEDURE PRINT 所用时间(总处理时间):
实际时间 0.00 秒
CPU 时间 0.00 秒
666 proc print data=out2;
667 var prin1-prin5;
668 run;
NOTE: 从数据集 WORK.OUT2 读取了 31 个观测。
NOTE: PROCEDURE PRINT 所用时间(总处理时间):
实际时间 0.00 秒
CPU 时间 0.00 秒