Stata The Stata listserver
[Date Prev][Date Next][Thread Prev][Thread Next][Date index][Thread index]

st: percentiles and locating a scalar in there.

From   "NEYMOTIN, FLORENCE" <[email protected]>
To   [email protected]
Subject   st: percentiles and locating a scalar in there.
Date   Mon, 25 Jul 2005 15:46:08 -0700

Hi, I have a question regarding percentiles that I've been having some trouble with...suppose that you have a variable x, and you have a scalar s, and you'd like to know at about what percentile of the x variable the s scalar falls. For instance, suppose x=1,2,3,...,1000. Then if you have s=20, it should be assigned the percentilie value of the 2nd percentile. Is there a way to do this easily in stata? (I wanted to assign the scalar a n approximate percentile EVEN IF IT'S NOT A VALUE in the variable itself so it can't be located in there) Everything I could think of would take quite a while.
Thank you for your help,
* For searches and help try:

© Copyright 1996–2024 StataCorp LLC   |   Terms of use   |   Privacy   |   Contact us   |   What's new   |   Site index