proc princomp와 직접 eigen values 계산 하는거랑 같은지 확인 해보기
data
data Q1;
input e1 - e6 p1 - p6;
cards;
121 22 74 223 54 254 132 17 77 232 50 249
108 30 80 175 40 300 123 32 79 192 64 315
122 49 87 266 41 223 129 31 96 250 55 319
77 37 66 178 80 209 131 23 67 291 48 310
140 35 71 175 38 261 110 24 96 239 42 268
108 37 57 241 59 245 47 22 87 231 40 217
124 39 52 194 72 242 125 32 87 227 30 324
130 34 89 200 85 242 129 29 102 234 58 300
149 55 91 198 50 277 130 26 104 256 58 270
129 38 72 162 47 268 147 47 82 240 30 322
154 37 87 170 60 244 159 37 80 227 58 317
145 33 88 208 51 228 135 41 83 216 39 306
112 40 60 232 29 279 100 35 83 183 57 242
120 39 73 159 39 233 149 37 94 227 30 240
118 21 83 152 88 233 149 38 78 258 42 271
141 42 80 195 36 241 153 27 89 283 66 291
135 49 73 152 42 249 136 31 83 257 31 311
151 37 76 223 74 268 97 36 100 252 30 225
97 46 83 164 31 243 141 37 105 250 27 243
109 42 82 188 57 267 164 32 76 187 30 264
;
proc print;
run;
covariance and correlation matrix
proc corr data = Q1 cov outp = Q1_corr;
var e1
run;
proc iml ;
use Q1_corr;
read all into A;
cov = A[1:6, 1:6];
corr = A[10:15 , 1:6];
print cov corr;
cov_val = eigval(cov);
cov_vec = eigvec(cov);
corr_val = eigval(corr);
corr_vec = eigvec(corr);
print cov_val;
print cov_vec;
print corr_val;
print corr_vec;
create cov_values;
append var {cov_val};
close cov_values;
create corr_values;
append var {corr_val};
close corr_values;
run;
quit;
procedure
proc princomp data = Q1 out = cov_out covariance;
var e1
run;
proc princomp data = Q1 out = cov_out;
var e1
run;
다행이도 같음.
당연한데 인자 분석으로 방법을 주성분 을 해도 같음
proc factor data = Q1 method = prin scree plot ;
var e1
run;
quit;
proc factor data = Q1 covariance method = prin scree ;
var e1
run;
quit;