title 'Example 1.5'; title2 'Example : Eigenvvalues and Vectors of S'; title3 'Run on PROC IML'; options ps = 60 ; data cardbd; infile 'T1-2.DAT' missover; input x1-x3; d1=x1-4; d2=x2-50; d3=x3-10; one=1; label x1='density ' x2='machdir' x3='crosdir'; proc iml; reset nolog nocenter fw=10 spaces=5; start; use cardbd; read all var {x1 x2 x3} into XT; X=XT` ; XBAR=X(|,:|); n=ncol(X); p=nrow(X); one=J(n,1,1); SSCP=X*(I(n)-(1/n)*one*one` )*XT; S=(1/(n-1))*SSCP; mu0={4,50,10}; call eigen(lambda,evectors,S); lambda=lambda`; SI=inv(S); print 'Summary Statistics: ' XBAR S, ; print 'Inverse of S: ' SI, ; print 'Eigenvalues of S: ' lambda,; print 'Eigenvectors of S:' evectors,; finish; run; quit;