Announcement

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

  • Markers from -scatter- not aligned with spikes from -rcap-

    I am trying to use raw data to make a graph plotting point estimates and confidence intervals. I am importing the data from Excel, not using margins to create it. So I am using -twoway- with both -scatter- and -rcap- in the same command. But when I do so, the markers from -scatter- appear to be not quite lined up perfectly with the lines from -rcap-. In other words, the spikes do not go through the center of the markers, but are slightly off. Here is some example code that does the equivalent of what I am trying to do. Does anyone know why this is happening or how I can fix it? Thank you.

    sysuse auto, clear
    keep in 1/4
    gen high = price + 1000
    gen low = price - 1000
    twoway (scatter price gear_ratio, mcolor(gs6) msize(medlarge) msymbol(D) mfcolor(white)) ///
    (rcap low high gear_ratio, lwidth(medthick) lpattern(shortdash) lcolor(gs6) msize(large))
Working...
X