Announcement

Collapse
No announcement yet.
X
  • Filter
  • Time
  • Show
Clear All
new posts

  • Is There an Equivalent to Jitter for Graph Dot to Use when Dots Overlap in Nearby Datapoints/

    Hi all,

    I've run into an instance where I believe graph dot is the best plot for my purposes, but that the distribution of the variable I am trying to plot for certain of my over groups are bunched together, and I'd like to do something similar to jitter to be able to show at least part of the dots in those bunched areas. But jitter seems not to be a valid graph dot option, so I'm uncertain of how to approach things. Here's a roughly equivalent data example

    HTML Code:
    clear all
    set obs 30
    set seed 48103
    gen group = runiformint(1, 6)
    forvalues i = 1/5{
    
    gen x`i' = runiform()/2 + 5 if inrange(group, 1, 3)
    replace x`i' = runiformint(1, 10) if inrange(group, 4, 6)
    
    }
    
    graph dot x1-x5, over(group)
    Which produces:

    Click image for larger version

Name:	Capture.PNG
Views:	1
Size:	68.5 KB
ID:	1685338

  • #2
    I don’t think there is any such option. You can do at least two things here to ease the problem:

    1. Give yourself more space by specifying exclude0.

    2. Use marker symbols better suited to overlap or occlusion, such as open (hollow) markers or plus or cross.

    Comment


    • #3
      If you are determined to jitter, then recasting the problem with twoway dot lets you do that. The solutions in #2 are I think much better for what I take to be your real problem.

      Comment


      • #4
        That makes sense - in my real case (rather than the toy data example I concocted), the range of my data includes large numbers and 0, so exclude0 can't help me much, but the idea of changing the markers is a good one that I will try.

        The writeup of twoway dot in the documentation is so forceful about the fact that the authors can't imagine a use case for twoway dot that I was hesitant to use it, but I may give it a try.

        Many thanks as always, Nick.

        Comment

        Working...
        X