Bookmark and Share

Notice: On March 31, it was announced that Statalist is moving from an email list to a forum. The old list will shut down on April 23, and its replacement, is already up and running.

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

st: RE: Jittering problem

From   Nick Cox <>
To   "''" <>
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)


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()-. 


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:

© Copyright 1996–2015 StataCorp LP   |   Terms of use   |   Privacy   |   Contact us   |   Site index