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]

st: RE: Jittering problem


From   Nick Cox <[email protected]>
To   "'[email protected]'" <[email protected]>
Subject   st: RE: Jittering problem
Date   Fri, 20 May 2011 15:13:59 +0100

This is more portable than Fred's example if you are not a collaborator of his and thus do not share his data. 

sysuse auto, clear

gen m = word(make, 1) 

scatter head rep78 if !foreign, jitter(8) ///
|| scatter head rep78 if foreign, jitter(8) scheme(bw)

more 

scatter head rep78 if !foreign, jitter(8) mla(m) ///
|| scatter head rep78 if foreign, jitter(8) scheme(bw) mla(m)

The essence of the problem appears to be that using marker labels inhibits jittering. I guess wildly that the way that jittering is implemented rules out -mla()- knowing exactly where to put the marker label, so jittering is ignored. 

So, I guess further that you need to pre-jitter yourself by adding random noise. An automated way to do this would use some fraction of the range of each variable multiplied by -runiform()-. 

Nick 
[email protected] 

Fred Wolfe

When I use this command, the graph will be jittered:

scatter fatig glb_ if ra_sev==0, jitter(8) || scatter fatig glb_ if
ra_sev >0, jitter(8) scheme(bw).

It will not be jittered when I use this command:


 scatter fatig glb_ if ra_sev==0,mfcolor(white) color(black) msize(
medlarge) mlabel(ptglobak) jitter(8) || scatter fatig glb_ if ra_sev
>0,mfcolor(black) xline(1.1)  msize(medlarge) msymbol(circle)
mlabel(ptglobak) jitter(8) scheme(bw).

 I couldn't find any discussion of this problem on the list. Any
suggestions to make jittering work?

*
*   For searches and help try:
*   http://www.stata.com/help.cgi?search
*   http://www.stata.com/support/statalist/faq
*   http://www.ats.ucla.edu/stat/stata/


© Copyright 1996–2018 StataCorp LLC   |   Terms of use   |   Privacy   |   Contact us   |   Site index