| ![]() |
From | Ana Guerrero Serdan <A.G.Guerrero-Serdan@rhul.ac.uk> |
To | statalist@hsphsun2.harvard.edu |
Subject | st: fraction ranking |
Date | Wed, 6 Dec 2006 09:42:37 +0000 (GMT) |
Hi, I have stata 9.1 and Im trying to do a fractional ranking of a discrete variable (x) with three values (1,2,3). Im using the following commands: sort x egen n=count(x) gen order=_n by x: egen i=rank(order) gen y=i/n I somehow dont get values for y in a fractional way? any ideas where Im doing wrong? thanks * * 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/
© Copyright 1996–2025 StataCorp LLC | Terms of use | Privacy | Contact us | What's new | Site index |