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: Macro Producing Different Results Each Time Executed
From
William Sankey <[email protected]>
To
[email protected]
Subject
Re: st: Macro Producing Different Results Each Time Executed
Date
Mon, 26 Aug 2013 12:40:18 -0400
Thank you all for these insightful comments/answers. This gives me
much to think about and consider--generally I need to understand what
kinds of datasets I'm merging and rarely (if ever) merge m:m.
Thanks again,
On Thu, Aug 22, 2013 at 5:02 PM, Nick Cox <[email protected]> wrote:
> Phil is right here.
> Nick
> [email protected]
>
>
> On 22 August 2013 22:00, Phil Schumm <[email protected]> wrote:
>> On Aug 22, 2013, at 3:57 PM, Phil Schumm <[email protected]> wrote:
>>> That's likely the best guess, looking at your code. Remember, -sort- is (by default) not stable, and one of the reasons for this is exactly so that problems like this are discoverable. In the future, whenever you are doing something that is dependent on the sort order of the data, use
>>>
>>> isid <varlist>, sort
>>>
>>> instead of -sort- to ensure that the order of the dataset is uniquely determined.
>>
>>
>> I see that a few folks have suggested using the -stable- option for sort, but note that that will simply mask the problem instead of solving it.
>>
>>
>> -- Phil
>>
>>
>> *
>> * 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/
--
William J. Sankey
Johns Hopkins University
MA Public Policy '12
*
* 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/