Hello,Everyone,
I got a problem as follows,
I have a vector with 10 values,say M= (10,20,30,40,50,60,70,100,120,130)
I also have a dataset with several variables,I want to compare each observation in one of the variables with each value in the vector above and create a new rank variable-RANK
For example, my dataset is
data scores;
input Name $ Test_1 Test_2 Test_3;
datalines;
Bill 187 97 103
Carlos 156 76 74
Monique 99 102 129
;
I want to compare Test_3 with M,for instance,
103 is between 8th(100) and 9th(120),then RANK=8;
74 is between 7th(70) and 8th(100),then RAND=7;
129 is between 9th(120) and 10th(130),then RANK=9;
For variable and vector are stored in different dataset,the length of the two are different,I don't know how to programming with it.
Thank you very much!
... View more