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: Routine from do-file that every time it's run gives a different result


From   "Radwin, David" <[email protected]>
To   <[email protected]>
Subject   RE: st: Routine from do-file that every time it's run gives a different result
Date   Fri, 8 Nov 2013 17:21:16 -0500

Another reference describing difference methods of calculating quantiles
that might be more accessible is
http://www.itl.nist.gov/div898/handbook/prc/section2/prc252.htm .

David
--
David Radwin, Senior Research Associate
Education and Workforce Development
RTI International
2150 Shattuck Ave. Suite 800, Berkeley, CA 94704
Phone: 510-665-8274

www.rti.org/education


> -----Original Message-----
> From: [email protected] [mailto:owner-
> [email protected]] On Behalf Of Clarice Martins
> Sent: Friday, November 08, 2013 1:42 PM
> To: [email protected]
> Subject: Re: st: Routine from do-file that every time it's run gives a
> different result
> 
> Thanks to all Nick, Sarah, Roberto e Segiy!!
> 
> Not only I stabilized the results, as I learned a lot about -sort- , -
> quantiles- , etc.
> 
> The problem was really at the use of random excess of -sort- commands
> before important steps were made. I reviewed every line using some of
the
> tools the group have provided:
> - 1st - used the -sum- after every new variable was created or
changed;
> - 2nd (in parallel actually) - used -isid- after every -sort- to
> understand if that -sort- was producing meaningful data. Then changed
> every -sort- command that caused an error message.
> 
> With these, it was easy to see that I was using some -sort- orders
that
> caused data that were not uniquely identified. (I still need to look
into
> the Quantiles methodology in depth.)
> 
> Thanks very much for your great advice!!
> 
> Clarice
> 
> 
> On Nov 7, 2013, at 4:16 PM, Nick Cox wrote:
> 
> > No. -xtile- sorts the data for you if they are not sorted, but
> > whatever it changes is done only temporarily.
> >
> > As Sergiy implies, subdivision by quantiles (e.g. quintiles) is
> > reproducible if you use the same rules for calculating quantiles.
> >
> > See also e.g. Hyndman and Fan on quantile calculation. There is a
copy
> > (licit or not) at
> >
> >
https://www.amherst.edu/media/view/129116/original/Sample+Quantiles.pdf
> >
> > Nick
> > [email protected]
> >
> >
> > On 7 November 2013 18:05, Clarice Martins
<[email protected]>
> wrote:
> >
> >> After Nick's comment:  (Thanks, Nick also!)
> >>>> And -xtile- is written -sortpreserve-
> >>>> so it doesn't change the sort order of your data.
> >>
> >>
> >> Do this means that I need to be aware of how data is sorted before
> using -xtile- ?


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