It is a matter of where counting starts.
Stata, like most (all?) statistical software,
assigns low ranks etc. to low values.
You want to slice off the high values, the top 15% etc., so
you must count down from the top.
pctile gr = score, nq(20)
xtile pc = score, cut(gr)
g str9 grade="Fail"
replace grade="Honors" if pc >=18
replace grade="High Pass" if pc>12 & pc<18
etc.
Nick
[email protected]
*
* For searches and help try:
* http://www.stata.com/support/faqs/res/findit.html
* http://www.stata.com/support/statalist/faq
* http://www.ats.ucla.edu/stat/stata/