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

st: RE: how to control jitering in scatter plots


From   "Nick Cox" <n.j.cox@durham.ac.uk>
To   <statalist@hsphsun2.harvard.edu>
Subject   st: RE: how to control jitering in scatter plots
Date   Tue, 5 Aug 2003 16:58:34 +0100

Ben Jann
> 
> Does anyone know how the random noise generator of the 
> jitering option in scatter plots can be controlled (Stata 8 
> and/or 7). I'd like to produce a series of related graphs 
> for didactical purposes. The data points are always the 
> same, however, some other stuff changes from graph to 
> graph. It would be really nice if the data points would be 
> jittered *exactly* the same way in each graph. (Up to now, 
> I just produced one graph with everything in it, and then 
> manually deleted whatever wasn't needed by editing the eps-file.)
> 
> My first guess was, that the jittering depends on the seed. 
> So I tried:
> 
>  set seed ...
>  scatter ...
> 
> This doesn't work, however.

I guess that the jittering does depend on 
the seed, but it won't remain constant 
from graph to graph, any more than you 
get the same sample of random numbers 
repeatedly even if the seed remains unchanged. 

For your purposes, I think you will need to produce  
one or more sets of random perturbations outside 
-scatter- and then add to your variables. To 
ensure that the perturbed variables have the 
same variable labels, value labels, format, 
etc. as your originals, there are various commands, among which 
-copydesc- on SSC is in the public domain. 

Nick 
n.j.cox@durham.ac.uk 
*
*   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