Dear all, How are you? I'm trying to run the code from this paper http://support.sas.com/resources/papers/proceedings14/2042-2014.pdf with my own data(8 5-level Likert items) but there is errors. Variable 'sumcor' seems like causing the problem. According to the paper, "Note that ∑ ∑ is just the sum of all values in the correlation matrix, since in a correlation matrix the diagonal elements are all 1, they sum to be the number of elements and the double sum adds up all off diagnonal elements (the correlations), note that each one would be repeated twice given the symmetry in the matrix." I'm a novice user of proc iml and your help is greatly appreciated. I have printed out a partial log output FYI. LOGIC(CALCALPHA.VARLIST): %DO loop index variable I is now 8; loop will iterate again. SYMBOLGEN: Macro variable I resolves to 8 MLOGIC(CALCALPHA.VARLIST): %DO loop index variable I is now 9; loop will not iterate again. MPRINT(CALCALPHA.VARLIST): rAttitudes01 rAttitudes02 rAttitudes03 rAttitudes04 rAttitudes05 rAttitudes06 rAttitudes07 rAttitudes08 MLOGIC(CALCALPHA.VARLIST): Ending execution. MPRINT(CALCALPHA): } into itemcor; SYMBOLGEN: Macro variable QS resolves to rAttitudes MPRINT(CALCALPHA): section="rAttitudes"; SYMBOLGEN: Macro variable CORDAT resolves to corrmatrix MPRINT(CALCALPHA): datused="corrmatrix"; MPRINT(CALCALPHA): numbitem=trace(itemcor); MPRINT(CALCALPHA): one=j(numbitem,1); MPRINT(CALCALPHA): print 'The Input Correlation'; MPRINT(CALCALPHA): print itemcor; MPRINT(CALCALPHA): print 'Number of items' numbitem; MPRINT(CALCALPHA): sumcor=(one)*itemcor*one; ERROR: (execution) Matrices do not conform to the operation. operation : * at line 4010 column 1 operands : one, itemcor one 7 rows 1 col (numeric) 1 1 1 1 1 1 1 itemcor 8 rows 8 cols (numeric) 0.999999 0.7418163 0.6005298 0.6328579 0.2149593 -0.085045 0.1591052 0.1087784 0.7418163 0.999999 0.6696118 0.639722 0.1674687 -0.127974 0.0821654 0.0697031 0.6005298 0.6696118 0.999999 0.8357702 0.2290657 -0.118532 0.136779 0.1264 0.6328579 0.639722 0.8357702 0.999999 0.2232193 -0.166345 0.1338478 0.137883 0.2149593 0.1674687 0.2290657 0.2232193 0.999999 -0.136473 -0.047612 0.1070489 -0.085045 -0.127974 -0.118532 -0.166345 -0.136473 0.999999 0.0824758 -0.076128 0.1591052 0.0821654 0.136779 0.1338478 -0.047612 0.0824758 0.999999 0.080517 0.1087784 0.0697031 0.1264 0.137883 0.1070489 -0.076128 0.080517 0.999999 statement : ASSIGN at line 4010 column 1 MPRINT(CALCALPHA): alpha=(numbitem/(numbitem-1))*(1-(numbitem / sumcor)); ERROR: (execution) Matrix has not been set to a value. operation : / at line 4010 column 1 operands : numbitem, sumcor numbitem 1 row 1 col (numeric) 7.999992 sumcor 0 row 0 col (type ?, size 0) statement : ASSIGN at line 4010 column 1 MPRINT(CALCALPHA): print alpha; ERROR: Matrix alpha has not been set to a value. statement : PRINT at line 4010 column 1 MPRINT(CALCALPHA): L = eigval(itemcor); MPRINT(CALCALPHA): theta=(numbitem/(numbitem-1))*(1-1/L[1]); MPRINT(CALCALPHA): print 'Theta'; MPRINT(CALCALPHA): print theta; SYMBOLGEN: Macro variable OUT resolves to alpha MPRINT(CALCALPHA): create alpha var {section datused alpha theta}; MPRINT(CALCALPHA): append; SYMBOLGEN: Macro variable OUT resolves to alpha MPRINT(CALCALPHA): close alpha; NOTE: The data set WORK.ALPHA has 1 observations and 4 variables. MPRINT(CALCALPHA): quit; NOTE: Exiting IML. 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 MPRINT(CALCALPHA): run; MLOGIC(CALCALPHA): Ending execution.
... View more