For the purpose of creating a table, I want to include the percentile of a given value within the distribution of a variable. In other words, if I have a variable named dens I'd like to know what percentile corresponds to value 0.229. I do not need to create a new variable with this value, but only to get the number in memory.
I've seen that _pctile does the opposite:
_pctile dens, p(15)
This will result in:
. return list
scalars:
r(r1) = .0229039993137121
Implying that the value 0.0229 corresponds to the 15th percentile in the distribution of dens.
Yet, I'm looking for a command in which I can input the value 0.0229 and STATA will return the percentile 15, in this example.
Thanks.
I've seen that _pctile does the opposite:
_pctile dens, p(15)
This will result in:
. return list
scalars:
r(r1) = .0229039993137121
Implying that the value 0.0229 corresponds to the 15th percentile in the distribution of dens.
Yet, I'm looking for a command in which I can input the value 0.0229 and STATA will return the percentile 15, in this example.
Thanks.
Comment