10-17-2011 10:00 PM
Hello SAS experts,
I have a series of variables and would like to choose the variable with the largest value.
I have ran a program that classifies the probability of individuals belonging to a specific class(y1-y8). I need to write a code to select the highest probability among these classes. I have attached a sample file with 10,000 examinees and their probability for belonging to each class. How can I select the variable with highest value/probability?
Thank you for any help in advance
10-17-2011 10:58 PM
Not quite sure from your question what type of maximum value you are looking for?
Here are two possible answers to two possible questions...
find the by row maximum value: the max function. ie. ymax=max(of y1-y8);
find the by column maximum value: one option is proc summary. ie. proc means data=out_2 max; var y1-y8; run;
10-17-2011 11:40 PM
I read your request slightly differently. Would the following provide what you want?
proc summary data=out_2;
output out=need (drop=_ mean=;
proc transpose data=need out=want;
having col1 eq max(col1)