Transform a matrix into a vector
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 | DATA LIST LIST /a1 TO a5. BEGIN DATA 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 END DATA. LIST. COMPUTE idx=$CASENUM. VECTOR a=a1 TO a5 /n(25F8). LOOP cnt=1 TO 5. COMPUTE n((idx-1)*5+cnt)=a(cnt). END LOOP. COMPUTE nobreak=1. * Collapse all 5 cases into one line. AGGREGATE /OUTFILE=* /BREAK=nobreak /n1 TO n25 = MAX(n1 TO n25). * If you need a column vector, uncomment the next 2 lines. *FLIP. *SELECT IF RTRIM(case_lbl) <>"NOBREAK". |
Related pages
...