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: how to access Stata's record of the variable data is sorted on


From   László Sándor <[email protected]>
To   [email protected]
Subject   Re: st: how to access Stata's record of the variable data is sorted on
Date   Tue, 24 Sep 2013 14:12:50 -0400

Thanks!

I cannot get it working in Mata though. st_local(":sorted by") returns
an empty string, while the local is accessed fine in Stata. What is
the way around this? (And why does this happen, by the way?)

On Mon, Sep 23, 2013 at 1:24 PM, Robert Picard <[email protected]> wrote:
> dis "`:sortedby'"
>
> On Mon, Sep 23, 2013 at 12:52 PM, László Sándor <[email protected]> wrote:
>> Hi,
>> [D] sort documents how Stata keeps track of the variable the data has
>> been sorted on, and you see this information as the last line of the
>> output from -describe-. However, I cannot find a way to access this
>> information and make use of it. Is there any?
>>
>> For those interested, I think I have a legitimate use case when I want
>> to use this. Sorting my data can take a long-long time, even if the
>> variable is categorical. But as I need a -tab- of the categories
>> anyway, I can utilize the frequencies returned to assign a rank for a
>> new sort order for -mf_collate-. This should be much faster. But I
>> would be happy to skip this step completely if the data is already
>> sorted on the variable when my command is invoked.
>>
>> Thanks!
>>
>> Laszlo
>> *
>> *   For searches and help try:
>> *   http://www.stata.com/help.cgi?search
>> *   http://www.stata.com/support/faqs/resources/statalist-faq/
>> *   http://www.ats.ucla.edu/stat/stata/
>
> *
> *   For searches and help try:
> *   http://www.stata.com/help.cgi?search
> *   http://www.stata.com/support/faqs/resources/statalist-faq/
> *   http://www.ats.ucla.edu/stat/stata/

*
*   For searches and help try:
*   http://www.stata.com/help.cgi?search
*   http://www.stata.com/support/faqs/resources/statalist-faq/
*   http://www.ats.ucla.edu/stat/stata/


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