/* Example 11.5.2 */ proc iml; x1={1,.657,.411,.574,.34,.213,-.09,-.049,-.033}; x2={.657,1,.689,.509,.755,.548,-.017,.008,.028}; x3={.411,.689,1,.275,.536,.722,.039,.037,.091}; x4={.574,.509,.275,1,.693,.295,.055,.038,.023}; x5={.34,.755,.536,.693,1,.725,.059,.068,.074}; x6={.213,.548,.722,.295,.725,1,.03,.028,.102}; x7={-.09,-.017,.039,.055,.059,.03,1,.851,.817}; x8={-.049,.008,.037,.038,.068,.028,.851,1,.901}; x9={-.033,.028,.091,.023,.074,.102,.817,.901,1}; R=x1||x2||x3||x4||x5||x6||x7||x8||x9; call eigen (D,H, R); cptv=0; do i=1 to 9; rr=J(1,i,1)*D[1:i,1]/trace(R); cptv=cptv//rr; end; cptv=cptv[2:10,]; /* We decide to choose first three components*/ Rsq=(H[,1:3]#H[,1:3])*D[1:3,]; H=H[,1:3]; print D cptv, H Rsq ; quit; D CPTV 3.7026872 0.4114097 2.7132225 0.7128789 1.0535904 0.8299445 0.7043085 0.908201 0.3011143 0.9416581 0.2332048 0.9675697 0.1692985 0.9863807 0.0913795 0.996534 0.0311943 1 H RSQ 0.3347347 -0.117779 0.5358726 0.7550623 0.4610452 -0.0815 0.0551339 0.8082775 0.4058442 -0.029001 -0.382194 0.7660499 0.3620933 -0.044033 0.5155181 0.7707267 0.4555949 -0.027204 -0.072753 0.7761392 0.3946999 -0.018826 -0.534743 0.8790704 0.0617228 0.5626268 0.048429 0.8754449 0.0698498 0.5788298 0.066126 0.931721 0.0867502 0.5692263 0.0029066 0.9070082