Re: [R] R question for Stata users

From: Frank E Harrell Jr <>
Date: Sun, 20 Apr 2008 07:46:51 -0500

Joe Trubisz wrote:
> Hi...
> In Stata, there is the ability to display scatter plots with data
> points at the same (x,y)
> location, using the 'jitter' command of the twoway scatter stata
> command.
> Anyone know of a way that I can do the equivalent thing in R?
> For non-Stata readers, if jitter is enabled in stata, and n-points
> would be at
> the same (x,y) location, the points are offset a bit (according to
> the jitter parameter)
> and you see all the points, though slightly offset from the original
> location.
> Thanks,
> Joe

In addition to the jitter function pointed out by others, the Hmisc package's jitter2 and scat1d functions written by Martin Maechler and myself implement Stata's approach to jittering large datasets whereby a randomly positioned fraction of the tick mark is displayed (default = 1/3 of the reference space).

Frank E Harrell Jr   Professor and Chair           School of Medicine
                      Department of Biostatistics   Vanderbilt University

______________________________________________ mailing list
PLEASE do read the posting guide
and provide commented, minimal, self-contained, reproducible code.
Received on Sun 20 Apr 2008 - 12:59:25 GMT

Archive maintained by Robert King, hosted by the discipline of statistics at the University of Newcastle, Australia.
Archive generated by hypermail 2.2.0, at Sun 20 Apr 2008 - 14:30:30 GMT.

Mailing list information is available at Please read the posting guide before posting to the list.

list of date sections of archive