Hi, I am looking to create a variable that corresponds to the proportion (or percentage) of observations that the current observation is larger than. For example, it should look like this:

Code:
clear
input id var1 rank
123 100 0.00
345 200 0.25
456 200 0.25
567 300 0.75
end
I have tried the following code
Code:
cumul var1, gen(rank)
But it just gives me the position in the distribution:

Code:
clear
input id var1 rank
123 100 0.25
345 200 0.5
456 200 0.75
567 300 1.00
end

I have looked at Nick's post and other postings here, but I have not found quite exactly what I wanted.

Any help would be appreciated. Thank you!