Announcement

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

  • Showing percentage on designbars

    Is it possible to show percent instead of count as stat on designbars:

    Code:
    designplot  Residence Education Wealth , stat(count) recast(hbar)
    Click image for larger version

Name:	Capture.JPG
Views:	1
Size:	248.8 KB
ID:	1466138


    Last edited by Sonnen Blume; 16 Oct 2018, 11:42.

  • #2
    You can show percents, but not with that syntax. You just sum 100 divided by the number of observations concerned.

    Code:
    sysuse auto , clear
    count if !missing(foreign, rep78)
    gen percent = 100/r(N)
    designplot percent foreign rep78, min(1) max(2) stat(sum) recast(hbar) blabel(total, format(%2.1f)) ytitle("")
    Click image for larger version

Name:	designplot.png
Views:	1
Size:	24.9 KB
ID:	1466148




    That said, you should (a) explain where designplot comes from and (b) update your version because the ? indicate a bug now fixed:

    SJ-17-3 gr0061_2 . . . . . . . . . . . . . . . Software update for designplot
    (help designplot if installed) . . . . . . . . . . . . . . N. J. Cox
    Q3/17 SJ 17(3):779
    help file updated

    SJ-15-2 gr0061_1 . . . . . . . . . . . . . . . Software update for designplot
    (help designplot if installed) . . . . . . . . . . . . . . N. J. Cox
    Q2/15 SJ 15(2):605--606
    bug fixed for Stata 14

    SJ-14-4 gr0061 Design plots for graphical summary of a response given factors
    (help designplot if installed) . . . . . . . . . . . . . . N. J. Cox
    Q4/14 SJ 14(4):975--990
    produces a graphical summary of a numeric response variable
    given one or more factors

    There is a bug in designplot. It allows missing as an option and then ignores it.

    Comment

    Working...
    X