Hi all, I am trying to generate a residual plot for a weibull survival model based on the code used in "SAS Textbook Examples Applied Survival Analysis by Hosmer, Lemeshow and May Chapter 8: Parametric Regression Methods" but I kept getting an error message about the matrices and I have tried all I could be to no avail. The fig84_a file in my own case has 9318 entries and 12 varaiables. I would greatly appreciate if someone can take look at it and point out what exactly I need to do to fix it. Below is my code and and error message received. /*********code******************************/ proc iml; use fig84_a ; read all variables {lint ltype1 lsupply1 lperiod lru ltype2 luic lttename1 ltraname lspeed lspeed2 lscale} into L; read all variables {pie_id status time1_cum type1 supply1 period ru type2 uic ttename1 traname speed speed2 mgale} into X; use covf84; read all var _num_ into V; dbeta = L*V; ld = J(100, 1, 0); do i = 1 to 100; ld = L[i,]*t(dbeta[i,]); end; W = X || dbeta ||ld; create fig84_b var {pie_id status time1_cum type1 supply1 period ru type2 uic ttename1 traname speed speed2 mgale dbint dbtype1 dbsupply1 dbperiod dbru dbtype2 dbuic dbttename1 dbtraname dbspeed dbspeed2 dbscale ld}; append from W; quit; /***********ERROR MESSAGE************************ 503 proc iml; NOTE: IML Ready 504 use fig84_a ; 505 read all variables {lint ltype1 lsupply1 lperiod lru ltype2 luic lttename1 ltraname lspeed 505! lspeed2 lscale} into L; 506 read all variables {pie_id status time1_cum type1 supply1 period ru type2 uic ttename1 506! traname speed speed2 mgale} into X; 507 use covf84; 508 read all var _num_ into V; 509 dbeta = L*V; ERROR: (execution) Matrices do not conform to the operation. operation : * at line 509 column 12 operands : L, V L 9318 rows 12 cols (numeric) V 24 rows 24 cols (numeric) statement : ASSIGN at line 509 column 3 510 ld = J(100, 1, 0); 511 do i = 1 to 100; 512 ld = L[i,]*t(dbeta[i,]); 513 end; ERROR: (execution) Matrix has not been set to a value. operation : [ at line 512 column 24 operands : dbeta, i, dbeta 0 row 0 col (type ?, size 0) i 1 row 1 col (numeric) 1 statement : ASSIGN at line 512 column 3 514 W = X || dbeta ||ld; ERROR: (execution) Matrices do not conform to the operation. operation : || at line 514 column 9 operands : X, dbeta, ld X 9318 rows 14 cols (numeric) dbeta 0 row 0 col (type ?, size 0) ld 100 rows 1 col (numeric) statement : ASSIGN at line 514 column 3 515 create fig84_b var {pie_id status time1_cum type1 supply1 period ru type2 uic ttename1 515! traname speed speed2 mgale dbint dbtype1 dbsupply1 dbperiod dbru dbtype2 dbuic dbttename1 515! dbtraname dbspeed dbspeed2 dbscale ld}; 516 append from W; ERROR: Number of columns in W does not match with the number of variables in the data set. statement : APPEND at line 516 column 3 517 quit; NOTE: Exiting IML. NOTE: The data set WORK.FIG84_B has 0 observations and 27 variables. NOTE: The SAS System stopped processing this step because of errors. NOTE: PROCEDURE IML used (Total process time): real time 0.06 seconds cpu time 0.06 seconds
... View more