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

Re: st: AW: RE: how to control jitering in scatter plots


From   vwiggins@stata.com (Vince Wiggins, StataCorp)
To   statalist@hsphsun2.harvard.edu
Subject   Re: st: AW: RE: how to control jitering in scatter plots
Date   Wed, 06 Aug 2003 10:27:07 -0500

Ben Jann <ben.jann@soz.gess.ethz.ch> wants to exactly reproduce jittering
patterns in repeated graph commands.  Nick Cox <n.j.cox@durham.ac.uk> noted
that this could not be done directly and suggested a work around.  Ben goes on
to ask specifically,

> Maybe I didn't express myself clear enough. What I expected was that
>
>  . set seed 3562
>  . scatter y x, jitter(2)
>  . set seed 3562
>  . scatter y x, jitter(2)
>
> would produce two identical graphs, just as
>
>  . set seed 3562
>  . gen v1=uniform()
>  . set seed 3562
>  . gen v2=uniform()
>
> produces two identical variables. This, however, is not the case.
> Ergo, the jitering does not seem to depend on the seed (unless I
> miss something here).

jitter() does not depend on the random-number seed because we thought that
users would appreciate not having simulations modified just because a graph
with jittering was drawn.  For that reason, jitter() uses a separate seed from
uniform().  Further, we thought that jittering should NOT be reproducible
because it is inherently random and picking a seed could lead to searching for
a "nice" jittering pattern that showed something not actually in the data.

In retrospect, the second point seems pretty heavy handed.  We are inclined to
leave jitter() dependent on its own seed and to add an option to -scatter-
that allows the seed to be set for a graph -- say jitterseed(#).  Look for
this option to appear in the next update -- sometime in mid August.


-- Vince                      -- Jeff
   vwiggins@stata.com            jpitblado@stata.com

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