Announcement

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

  • Faded Box Plot

    I am using Stata/IC 14.2. When I develop box plots, sometimes one of the box plots appear faded. I have enclosed an example of what I am speaking of (see far right box plot).

    In the code below, I am graphing a continuous variable ("volume") across categories of a nominal variable ("randomnum").

    Any thoughts would be welcomed.

    Donny

    Code:
    *Prime Volume - RAP Volume*
    capture drop median
    egen median= median(volume), by(randomnum)
    sum volume, det
    di r(p50)
    local x=r(p50)
    local x: di %9.1f `x'
    graph box volume if volume>=100, yline(`r(p50)') ylabel(, angle(0)) over(n_no_circ, label(angle(rvertical)) sort(median)) nooutsides ytitle("Prime Vol - RAP Vol (ml)") title ("Net Prime Volume (ml) by Center") note("Not Using Circulatory Arrest" "Net Vol=Prime Vol - RAP Vol" "Only Includes Cases Matched to Surgical Records" "Red line:median value across the database is:`x' ml")
    Click image for larger version

Name:	Capture.PNG
Views:	1
Size:	39.7 KB
ID:	1373080

  • #2
    You may be trying to draw boxes where there is no data (or very little). If so, combining boxes may be the solution.
    You can start with
    Code:
    tab n_no_circ
    bys n_no_circ : su volume
    and then combine the empty or near-empty boxes.

    Another possibility is that if you have too many groups when using over() with boxplots, the later boxes are not always correctly drawn. The obvious thing to do is reduce the number of groups, but that is not really a solution. This looks like a problem within Stata, so I suggest hat you contact Stata help & see what they can say. Perhaps, .

    Comment

    Working...
    X