Rick- Thanks again for your help with developing a robust PCA. I'm a novice user of IML. I'm working with the SAS document you wrote -- Paper 329-2010 Rediscovering SAS/IML® Software: Modern Data Analysis for the Practicing Statistician. In addition, I have your book on Statistical Programming with SAS/IML. The matrix I'm analyzing for the robust PCA is 40 columns by 900 rows. I have a question for you about some code in your paper: On page 9 you write: /* compute PCA of robust covariance matrix */ p = ncol(x); /* 20 variables */ RobustCov = est[3:2+p, ]; /* robust estimate of shape parameters */ call eigen(eVal, eVec, RobustCov); /* PCA = eigenvectors of RobustCov */ I can't find any documentation on the "est" function in your book. So, when you write RobustCov = est[3:2+p, ]; What exactly is that line of IML code doing? Is the "3:2+p" based on the sample data you're using? If I want to rewrite that line of code for the 40x900 matrix I'm working with, what would it look like? Currently, I'm getting errors with a simple replication of your code: Cut and paste of IML error messages in my SAS log: p=ncol(x); RobustCov=ext[3:2+p, ]; ERROR: (execution) Matrix has not been set to a value. operation : [ at line 1231 column 14 operands : ext, *LIT1001, _TEM1001, ext 0 row 0 col (type ?, size 0) *LIT1001 1 row 1 col (numeric) 3 _TEM1001 1 row 1 col (numeric) 39 statement : ASSIGN at line 1231 column 1 1232 call eigen(eVal, Evec, RobustCov); ERROR: (execution) Character argument should be numeric. operation : EIGEN at line 1232 column 1 operands : RobustCov RobustCov 0 row 0 col (type ?, size 0) statement : CALL at line 1232 column 1 1233 VarExplained=cusum(eval)/sum(eval); ERROR: (execution) Matrix has not been set to a value. operation : CUSUM at line 1233 column 19 operands : eval eVal 0 row 0 col (type ?, size 0) statement : ASSIGN at line 1233 column 1 1234 NumPC=1; 1235 RobustLoc=est[1,]; ERROR: (execution) Matrix has not been set to a value. operation : [ at line 1235 column 14 operands : est, *LIT1004, est 0 row 0 col (type ?, size 0) *LIT1004 1 row 1 col (numeric) 1 statement : ASSIGN at line 1235 column 1 1236 c=(x-RobustLoc); ERROR: (execution) Matrix has not been set to a value. operation : - at line 1236 column 5 operands : x, RobustLoc x 897 rows 37 cols (numeric) RobustLoc 0 row 0 col (type ?, size 0) statement : ASSIGN at line 1236 column 1 1237 Scores=c*eVec[,1:NumPC]; ERROR: (execution) Matrix has not been set to a value. operation : [ at line 1237 column 14 operands : eVec, , *LIT1005, NumPC Evec 0 row 0 col (type ?, size 0) *LIT1005 1 row 1 col (numeric) 1 NumPC 1 row 1 col (numeric) 1 statement : ASSIGN at line 1237 column 1 1238 print scores; ERROR: Matrix Scores has not been set to a value. statement : PRINT at line 1238 column 1 1239 1240 create RobustPCA var {pgm scores}; 1241 append; 1242 close robustpca; NOTE: The data set WORK.ROBUSTPCA has 897 observations and 2 variables. What am I doing wrong? THank you, Thomas
... View more