.- help for ^altrank^ [STB-51: dm72] .- . Alternative ranking procedures ------------------------------ . ^egen^ [type] newvar ^=^ fcn^(^exp^)^ [^if^ exp] [^in^ range] [^, by(^varlist^)^ ] . . Description ----------- . (This is the general specification modified from the help for ^egen^.) . ^egen^ creates newvar of the optionally specified storage type equal to fcn^(^exp^)^, where exp denotes an expression. . Note that ^egen^ may change the sort order of your data. . ^egen^ functions for alternative ranking procedures ------------------------------------------------- . ^rankf(^exp^)^ [ ^, by(^varlist^)^ ] calculates the field rank of exp: the highest value is ranked 1, and there is no correction for ties. Two values that are 2nd equal remain rank 2. . ^rankt(^exp^)^ [ ^, by(^varlist^)^ ] calculates the track rank of exp: the lowest value is ranked 1, and there is no correction for ties. Two values that are 2nd equal remain rank 2. . ^ranku(^exp^)^ [ ^, by(^varlist^)^ ] calculates the unique rank of exp: values are ranked 1, ... , #values and ties are broken arbitrarily. Two values that are second equal are ranked 2 and 3. . . Options ------- . ^by(^varlist^)^ specifies that ranks are to be calculated separately for the distinct groups defined by varlist. . . Examples -------- . . ^egen mpgrank = rankt(mpg)^ . ^lbleqrnk mpgrank^ . ^l make mpg mpgrank in 1/10^ . . Authors ------- . Nicholas J. Cox, University of Durham, U.K. n.j.cox@@durham.ac.uk . Richard Goldstein richgold@@ix.netcom.com . . Also see -------- . Manual: ^[R] egen^ On-line: help for @egen@, @lbleqrnk@ (if installed)