** Run Gamblers.sas to get data **; goptions reset=all; *(1) Create a new variable and split off the type variable for a later label; data g2; set gamblers; nm = compress(type||sub); proc print data=g2(obs=40); run; data labels; set g2; keep type; proc print data=labels(obs=40); run; *(2) Transpose so the columns represent people and the rows questions; proc transpose data=g2 out=questions; var dsm1-dsm12; id nm; proc print data=questions; var steady1--control20; run; *(3) Correlate the 100 people; proc corr data=questions out=corrquest noprint; var steady1--binge99; data corrquest; set corrquest; if _TYPE_="CORR"; proc print data=corrquest(obs=7); var steady1--control7; run; *(4) Perform multidimensional scaling into 3 dimensions then add with the labels; proc MDS data=corrquest out=MDS2 similar dim=3; var steady1--binge99; data mds2; set mds2; if _TYPE_="CONFIG"; data mds2; merge mds2 labels; *(5) Graphics - also try INSIGHT; proc gplot; plot dim1*dim2=type; plot dim1*dim3=type; symbol1 v=dot i=none; run;