Announcement

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

  • Stripplot - no box or median plotted

    I am using stripplot (from SSC) to describe some data:
    Code:
    * Example generated by -dataex-. To install: ssc install dataex
    clear
    input int v1 byte(v2 v3)
      6 16 24
      6 24 24
     17 32 32
     17 42 42
     17 48 48
     17 48 48
     17 48 48
     17 53 56
     17 56 64
     17 64 64
     17 64 80
     17 64 95
     17 64  8
     17 64  8
     17 80  8
     17 95  8
     17 95  8
     17  8  8
     17  8  8
     17  8  8
     17  8  8
     17  8  8
     17  8  8
     17  8  8
     17  .  8
     17  .  8
     17  .  8
     17  .  8
     17  .  8
     33  .  8
     50  .  8
     50  .  8
     67  .  8
     89  .  8
    100  .  8
    100  .  8
    100  .  8
    111  .  8
    117  .  8
    133  .  8
    133  .  8
    133  .  8
    133  .  8
    133  .  8
    167  .  8
    200  .  8
    200  .  8
      .  .  8
      .  .  8
      .  .  8
      .  .  8
    end

    Code:
    . tabstat v1 v2 v3, stats(n mean sd p50 p25 p75 iqr min)
    
    . tabstat v1 v2 v3, stats(n mean sd p50 p25 p75 iqr min) f(%5.1f)
    
       stats |        v1        v2        v3
    ---------+------------------------------
           N |      47.0      24.0      51.0
        mean |      53.6      42.2      18.4
          sd |      55.9      28.8      21.4
         p50 |      17.0      48.0       8.0
         p25 |      17.0       8.0       8.0
         p75 |     100.0      64.0       8.0
         iqr |      83.0      56.0       0.0
         min |       6.0       8.0       8.0
    ----------------------------------------
    
    stripplot v1 v2 v3, box vert sch(s1color)
    [
    Click image for larger version

Name:	strip.png
Views:	1
Size:	42.3 KB
ID:	1544363
    When I plot the data I can understand why p25 and p50 are coincident for v1 but I cannot understand why there is no median or quartiles for v3.
    It is probably so obvious that I cannot see it but I would be grateful for any help.

    Thank you,
    Martyn

    Stata(IC) 16.1

  • #2
    Well, from your results and from


    Code:
     stripplot v1 v2 v3 , vertical box cumul scheme(s1color)
    it can be seen that median and quartiles coincide at 8 for v3 -- so you're expecting to see a box of zero height. It's there, just hard to see.

    Click image for larger version

Name:	martyn.png
Views:	1
Size:	29.0 KB
ID:	1544369


    (Stata's rules here, not something imposed by or requested by stripplot.)

    Comment


    • #3
      So obvious I could not see it!

      Thank you for the improved plot.

      Martyn

      Comment


      • #4
        You’re welcome. The boxes should be moved left and made thinner.

        Comment

        Working...
        X