Hi everyone,
I have a matrix created based on raw data. I want to use this matrix as input for cluster analysis. Can anyone help me to define that matrix as input? Here is the code I use. I tried that code but it did not work. I don't know what I'm missing. I also attached raw data I used.
Thanks
data tr;
infile 'C:\coll_gen\N100\GROUP10\COMP40\PHI25\gbt\RESULTS-SIG1.OUT';
input CAND_1$ CAND_2$ ID_1 ID_2 THETA_1 THETA_2 MATCHES RT_PROB FLAG ;
run;
proc iml;
use tr nobs nobs;
read all var{CAND_1 CAND_2 RT_PROB};
close;
levels=unique(CAND_1||CAND_2);
matrix1=j(ncol(levels),ncol(levels),.);
mattrib matrix1 r=((levels)) c=((levels)) label='' ;
row=(CAND_1);
col=(CAND_2);
do i=1 to nobs;
r=row[i];c=col[i];p=RT_PROB[i];
matrix1[r,c]=p;
end;
print matrix1;
quit;
ods graphics on;
proc cluster data=matrix1 method=ward ccc pseudo out=tree;
var RT_PROB;
id CAND_1;
run;
ods graphics off;
proc tree data=matrix1 out=New nclusters=5 noprint ;
height _rsq_;
copy RT_PROB ;
run;