Hello, I am also trying to create a 12x12 symmetrical matrix using 2 column character variables : ID and Disease (categorical, 12 categories) Each ID may have more than 1 Disease observation How can I adapt the code above to display (report) a 12x12 matrix (ie. cross-tabulate for co-occurance of the diseases) I have tried the following code, but no matrix displays, just a table with 4 colomns (ID, Disease, count, percent) : data temp; array x{9999} $ 40 _temporary_; do i=1 by 1 until(last.ID); set sasuser.diseasecat; by ID; x{i}=Disease; end; do m=1 to i; do n=m to i; v1=x{m}; v2=x{n}; output; if n ne m then do; v2=x{m}; v1=x{n}; output; end; end; end; keep ID Disease; run; proc freq data=temp; table IdParticipant*Group/out=temp1 list nopercent nocum; run; proc transpose data=temp1 out=want(drop=_:); by ID; id Disease; var count; run; proc print data=temp1; run; Many thanks for your help.
... View more