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   [email protected] (Vince Wiggins, StataCorp)
To   [email protected]
Subject   Re: st: AW: RE: how to control jitering in scatter plots
Date   Wed, 06 Aug 2003 10:27:07 -0500

Ben Jann <[email protected]> wants to exactly reproduce jittering
patterns in repeated graph commands.  Nick Cox <[email protected]> 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
   [email protected]            [email protected]

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