06-16-2014 06:55 PM
Suppose I have the dataset below. Is there a function or technique that would allow me to scale each variable from 1 to 100 based upon user-defined (not actual) minimum and maximum values for each variable, respectively? For instance, I'd like a variable called Ratio_1_std that would score ratio_1 variables based upon how far they are into the range from 0 to 50. And I'd like a variable called Ratio_2_std that would score ratio_2 from 0 to 100 based upon a different range, perhaps 5 to 55. Values below the minimum and maximum provided would get scores of 1 and 100, respectively. I can simply code the desired results manually for each variable, but I'm looking for a potential function or technique that will do this based upon parameters I provide for each variable to minimize coding and to more easily apply this technique to many variables.
INPUT ID RATIO_1 RATIO_2;
1 25 50
2 5 10
06-16-2014 08:38 PM
Try Proc stdize and/or call stdize.
Proc if your standardizing down a column and call stdize if its across columns, i.e. a row.
06-16-2014 10:20 PM
Still not sure if I have understand what you are after, it would be great if you can lay out some sample outcome based on your input data. But I have a feeling that you may want to check out PROC FCMP or DS2 custom method or simply PROC FORMAT.