Bookmark and Share

Notice: On April 23, 2014, Statalist moved from an email list to a forum, based at statalist.org.


[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: st: rowranks/ ranking only a selection of variables (subgroup of ordered variables)


From   Nick Cox <[email protected]>
To   [email protected]
Subject   Re: st: rowranks/ ranking only a selection of variables (subgroup of ordered variables)
Date   Sat, 10 Mar 2012 10:46:12 +0000

-rowranks- is from the Stata Journal.

SJ-9-1  pr0046  . . . . . . . . . . . . . . . . . . .  Speaking Stata: Rowwise
        (help rowsort, rowranks if installed) . . . . . . . . . . .  N. J. Cox
        Q1/09   SJ 9(1):137--157
        shows how to exploit functions, egen functions, and Mata
        for working rowwise; rowsort and rowranks are introduced

Please remember to specify where user-written programs you use come
from. Author's name is not a place!

Nick

On Sat, Mar 10, 2012 at 9:18 AM, Nick Darson <[email protected]> wrote:

> Thanks Maarten, that did help!!
>
> Sorry, still quite new to Stata ...
>
> Cheers
> Nick
>
> On Sat, Mar 10, 2012 at 8:04 PM, Maarten Buis <[email protected]> wrote:
>> On Sat, Mar 10, 2012 at 4:38 AM, Nick Darson  wrote:
>>> However, in my case each person has faced several subsets of choices
>>> (example: only option0, option2, option3, option4, option8) and I need
>>> to create the ranking order of each subject for each subset.
>>>
>>> The problem is (to my understanding) that rowranks requires always a
>>> consecutive order of the variables that are ranked (e.g., syntax is:
>>>  rowranks x1-x5, gen(rank_x1-rank_x5) )
>>
>> That is incorrect, -rowrnks- requires a varlist: see -help varlist-.
>> So you can type -rowranks(x1 x2 x5 x300000), ...-. Notice, that there
>> are no commas between the variable names.
>>
>> The varlist x1-x5 is just a short-cut that is sometimes useful. I
>> actually hardly ever use it. Instead I tend to make heavy use of the *
>> and ? characters. Neither shortcut will help you in this case, you'll
>> just have to explicitly spell the entire list, which is not a problem
>> just more work.

*
*   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/


© Copyright 1996–2018 StataCorp LLC   |   Terms of use   |   Privacy   |   Contact us   |   Site index