Hello
Foe each customer I have a data set with wealth value and also values of percentiles that were calculated from all data.
My purpose- For each customer find to which percentile the value wealth belong.
For example:
wealth 300 belong to P90
wealth 50 belong to P20
What is the way to classify each value to percentile group?
Data have;
input CustID wealth P5 P10 P20 P30 P40 P50 P60 P70 P80 P90 P95 ;
cards;
1 300 20 40 70 90 120 150 200 230 280 400 500
2 50 20 40 70 90 120 150 200 230 280 400 500
;
Run;
Your P: variables look redundant to me. Do they have the same values over all observations?
Of those P variables are to be the same for every value of "wealth" then create a format to display the desired values, or even the text "PXX".
RULES not EXAMPLES.
What you have given us means we cannot have a good chance of what to do with a value of 113.
Plus, you may want to look closely at the definition of percentiles. Looking at those values I would have a hard time agreeing that 300 was in the 90th percentile, 80th perhaps but not 90th.
Good news: We've extended SAS Hackathon registration until Sept. 12, so you still have time to be part of our biggest event yet – our five-year anniversary!
Learn how use the CAT functions in SAS to join values from multiple variables into a single value.
Find more tutorials on the SAS Users YouTube channel.
Ready to level-up your skills? Choose your own adventure.