Hi everyone! Could someone maybe help me out?
I think I have a relatively easy question; at least I hope so! As usual I find it hard to exactly explain what I am looking for but I hope it works out.
Let's say I have values for persons with the maximum rental prices they want to pay. I also have actual prices of all rental homes. I want to calculate for how many people only the cheapest 10% of houses are obtainable, then I also want to calculate for how many people only the cheapest 20% of houses are obtainable and so forth. Preferably I want to have the value for the percentage for every percent of houses to be able to show the cleanest and smoothest line in a graph. So I don't want 50% on the x-axis to be the average price but I want it to be the median. I then want to graph this cumulative percentage line of searchers per percentage of total objects that can't afford the rest of the number of total objects with a higher price.
I hope the following example of a dataset helps:
Thank you in advance!
I think I have a relatively easy question; at least I hope so! As usual I find it hard to exactly explain what I am looking for but I hope it works out.
Let's say I have values for persons with the maximum rental prices they want to pay. I also have actual prices of all rental homes. I want to calculate for how many people only the cheapest 10% of houses are obtainable, then I also want to calculate for how many people only the cheapest 20% of houses are obtainable and so forth. Preferably I want to have the value for the percentage for every percent of houses to be able to show the cleanest and smoothest line in a graph. So I don't want 50% on the x-axis to be the average price but I want it to be the median. I then want to graph this cumulative percentage line of searchers per percentage of total objects that can't afford the rest of the number of total objects with a higher price.
I hope the following example of a dataset helps:
Code:
clear input float(searcherid objectprice maxprice objectid) 1 3 10 1 2 5 12 2 3 8 23 3 4 1 21 4 5 15 18 5 6 25 17 6 7 21 8 7 8 13 30 8 9 19 21 9 10 30 19 10 11 32 23 11 . . 15 12 . . 16 13 . . 19 14 . . 30 15 . . 31 16 end

Comment