Announcement

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

  • #16
    As a footnote to Andrew Musau's excellent answer here is an example of tabplot in action.

    As flagged in https://www.statalist.org/forums/for...ories-per-cell the design idea goes back at least to Charles Booth in 1889.

    tabplot can appeal if you prefer

    * to lose a legend as being at best a necessary evil

    * a clearer distinction between outcome and control

    * a hybrid of graph and table (which Andrew's design also offers).

    Colours are allowed too; this particular choice is offered on a day when I lean to Bauhaus-Shaker-Tufte minimalism. The latter may be forced on you if you publish in a place where multiple colours are not allowed or far too expensive.

    Click image for larger version

Name:	minimal.png
Views:	1
Size:	43.9 KB
ID:	1786518


    Code:
    clear
    input float(n treat1 treat2 treat3 treat4)
    1 2 2 1 .
    2 2 3 3 3
    3 2 3 3 3
    4 2 . . .
    5 2 2 2 2
    6 1 1 2 1
    7 3 3 3 3
    8 2 2 2 .
    9 2 2 2 2
    10 2 . . .
    11 2 2 1 2
    12 2 . . .
    13 2 3 3 3
    14 2 2 2 .
    15 2 . . .
    16 2 . . .
    17 2 2 3 .
    18 2 . . .
    19 2 2 2 2
    20 2 2 1 2
    21 0 0 1 .
    end
    
    reshape long treat, i(n) j(origin)
    drop if missing(treat)
    
    label values origin origin
    label def origin 1 "SUB-dose-MC", modify
    label def origin 2 "TA-MC", modify
    label def origin 3 "SUPER-dose-MC", modify
    label def origin 4 "TI-MC", modify
    
    label values treat treat
    label def treat 0 "Inconclusive", modify
    label def treat 1 "Under-treatment", modify
    label def treat 2 "Adequate", modify
    label def treat 3 "Over-treatment", modify
    
    set scheme  stcolor
    
    tabplot treat origin, percent(origin) showval subtitle(%) ///
    ytitle("") xtitle("") blcolor(black) bfcolor(none)

    Comment


    • #17
      Hello, Andrew!

      Thank you for your reply.
      However, this is still not the type of graph bar I need.
      Please see the new example below showing the layout I'm trying to achieve.
      I'd like the variables to be arranged in the graph bar as shown in the example, using the same dataset that I posted previously.

      Attached Files

      Comment


      • #18
        Sorry, but what's the difference beyond text labels?

        Comment

        Working...
        X