Stata The Stata listserver
[Date Prev][Date Next][Thread Prev][Thread Next][Date index][Thread index]

Re: st: sort


From   Luhang Wang <[email protected]>
To   [email protected]
Subject   Re: st: sort
Date   Tue, 21 Jun 2005 01:15:51 -0400

Thanks Richard, that's the point.



On 6/21/05, Richard Williams <[email protected]> wrote:
> At 11:21 PM 6/20/2005 -0400, Luhang Wang wrote:
> >When I change the codes to "sort hhid x_temp", I get stable result.
> >Does this work the same way as the stable option? The previous results
> >are generally smaller than that after the change.
> 
> The more variables you sort on, the more likely you are to get a unique and
> hence stable sort order.  But, there is no automatic guarantee that a 2 (or
> 1, or 3, or 4, or whatever) variable sort will produce a unique/stable
> sort.  Again, if it is important to always get the same results, use the
> -stable- option.
> 
> >However, I'm still not clear how the stable option may affect my
> >result, since given the way x_temp is generated, it is the same for
> >all the observations with the same hhid.
> 
> Are you sure about that?  I'm not quite sure what that code produces, but
> it seems like the if statement could be true and false for different cases
> with the same hhid, hence it matters which cases make the cut. (e.g. first
> case, hhid = 1, x_exp = -2, egen statement gets executed; 2nd case, hhid =
> 1, x_exp = 0, egen statement does not get executed).  Without trying it I
> am not sure, but you may want to double-check that egen statement to see if
> it is doing what you want it to do.
> 
> -------------------------------------------
> Richard Williams, Notre Dame Dept of Sociology
> OFFICE: (574)631-6668, (574)631-6463
> FAX:    (574)288-4373
> HOME:   (574)289-5227
> EMAIL:  [email protected]
> WWW (personal):    http://www.nd.edu/~rwilliam
> WWW (department):    http://www.nd.edu/~soc
> 
> *
> *   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/
>

*
*   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–2024 StataCorp LLC   |   Terms of use   |   Privacy   |   Contact us   |   What's new   |   Site index