Announcement

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

  • catplot, bar graph displayed vertical

    Hi,
    I'm creating stack bar graph with categorical var: beh_resultat (8 categories) stacked above the variable aar (6 categories)
    Which works fine with the command, however I would like to display the graph as vertical and not horizontal (aar on the x-axis and % on the y-axis).


    catplot beh_resultat aar, percent(aar) asyvars stack

    Help is much appreciated, thanks

    Larsen Inge

  • #2
    catplot is from SSC authored by Nick Cox. You are asked to identify user written commands, refer to the FAQs. Include the option

    Code:
    recast(bar)

    Comment


    • #3
      Andrew is right. See also the help for catplot. Here are some extracts:

      catplot catvar1 [catvar2 [catvar3]] [weight] [if exp] [in range] [ ,
      {fraction|fraction(varlist)|percent|percent(varlis t)}
      var1opts(over_options) var2opts(over_options) var3opts(over_options)
      recast(plottype) graph_options ]
      Optionally catplot may be recast as a wrapper for graph bar or graph dot.
      recast() recasts the graph to another plottype, one of hbar, bar, dot. Note for experienced users:
      although the name is suggested by another recast() option, this is not a back door to recasting to a
      twoway plot.
      Code:
          . catplot rep78, by(foreign) percent(foreign) recast(bar)
      Code:
          . gen himpg = mpg > 25
          . label def himpg 1 "mpg > 25" 0 "mpg <= 25"
          . label val himpg himpg
          . catplot rep78 foreign, recast(bar) by(himpg, row(1) note("")) subtitle(, pos(6) ring(1) bcolor(none)
              nobexpand)

      Comment

      Working...
      X