I know this is simple but I can't seem to figure it out.
I have a dataset that has 50 students, and one of the columns is called test score which has a test score for each of the students. I need to go through and find the difference between all of the students- so student 1 score- student 2 score, student 2 score-student 3 score..... to 50 then student 2 score-student 3 score,... student 2 score-student 50 score.
I essentially need to end up with a matrix of differences for the test scores.
I have to use an array- so it would be something like Data: Student Score Alejandro 91 Atkinsin 87 Beal 72 Butler 94 Coleman 91
data array;
set testscores;
array score(50) Score1-Score 50; ?I dont think this is correct
do i=1 to 50;
difference= score(i) -score(i+1)?? I really have no idea everything I try isn't working
end;
run;
I need to end up with something that has the difference between every students scores