Hi,
It couldn't get more basic than this. I'm creating a binary variable
y. The criteria for y to be equal to one is that the value of x is
greater than its 10th percentile value. Otherwise it'll be zero.
So I tried to this, but it didn't work:
********************************
gen y=0
replace y=1 if x>p10(x)
********************************
Now, I know I can collapse x and get p10 that way, and then use the
p10 value to create y. But I want something just a tiny bit more
elegant to impress my boss.
Please help.
Thanks in advance,
PV
*
* For searches and help try:
* http://www.stata.com/help.cgi?search
* http://www.stata.com/support/statalist/faq
* http://www.ats.ucla.edu/stat/stata/