Hi SAS Experts, Need some help! I'm trying to start with a given "student list", to create a "synergy list" that looks like below. I've tried many different ways, still no success yet. /* Student List */ data student; infile datalines dlm=','; input STUDENT_ID $3 SUBJECT1-SUBJECT5; datalines; 001,1,0,0,1,1 002,0,0,1,1,1 003,0,1,1,0,1 004,1,1,0,1,0 ; /* Synergy List */ data synergy; infile datalines dlm=','; input STUDENT_ID $3 STUDENT1-STUDENT4; datalines; 001,3,2,1,2 002,2,3,2,1 003,1,2,3,1 004,2,1,1,3 ; The idea is this. With a list of students and the subjects they are interested in (value "1" equals interested), I would like to find out for each student which of their friends have the best synergy with them, ie. someone who share the most subjects they both like. The plan is for each common interested subject between two students, I will assign a "synergy score" of 1. Eg. if student 001 and 002 both like Biology and English, they would be assigned a synergy score of "2" between them. In another words, I would like to figure a way to get a "synergy list" from a "student list". The synergy list is a N*N table with the synergy score between each student pair combination. N is total number of students. For example, from the Synergy list above, I can tell Student 001 has the highest synergy score with 002 and 003 (both has synergy score of "2" with 001), which is potentially good for pair up. Any tips or help is appreciated!!
... View more