[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

From |
"Nick Cox" <n.j.cox@durham.ac.uk> |

To |
<statalist@hsphsun2.harvard.edu> |

Subject |
RE: st: RE: frequency bar charts of string variables |

Date |
Thu, 23 Jul 2009 11:55:27 +0100 |

Thanks to Martin for acting here as my own tech-support. The use of -oversubopts()- is the correct solution here. The statement -gen one = 1- is left over from some previous discussion. In designing -catplot- syntax there is a tension between two extremes. By analogy with say -histogram- users might expect the syntax to be along the lines of catplot [bar|hbar|dot] varlist, [options] whereas by analogy with say -graph pie- other users might expect the syntax to be along the lines of catplot [bar|hbar|dot] , over(var1) [over(var2) [over(var3)]] I chose the former, but it has some disadvantages too. Even 6 years on from introducing -catplot-, I might yet change my mind, at least in terms of allowing the latter as an alternative. Nick n.j.cox@durham.ac.uk Martin Weiss Here is the full solution. You have to use an undocumented option... *** sysuse auto, clear decode foreign, gen(Foreign) gen one = 1 catplot hbar Foreign, /* */ oversubopts(label(labsize(vlarge))) /* */ ylabel(, labsize(vlarge)) *** Florian Wakolbinger i have another question related to my previous one: is there any possiblity to change the size of the axis-labels of both the yaxis as well as the categorical axis at the command "catplot hbar..." Nick Cox schrieb: > There are commands to do this, which I presume is what you want. In > official Stata it is not too difficult. First read in suitable data > > . sysuse auto > (1978 Automobile Data) > > Suppose that -foreign- were a string variable, which we can simulate > with > > . decode foreign, gen(Foreign) > > Now go > > . gen one = 1 > > . graph hbar (sum) one, over(Foreign) ytitle(frequency) > > However, the user-written command -catplot- from SSC may prove more > convenient. > > . catplot hbar Foreign > > For -hbar- read also -bar-, for vertical versions usually more difficult > to read. > > Nick > n.j.cox@durham.ac.uk > > Florian Wakolbinger > > is there an option in stata to draw bar charts of string variables, i.e. > > if the variable contains 40 "yes" and 60 "no", to draw a chart with two > bars of height 40 and 60? > > to put it differently, is there an option to visualize the results of > the command tab varname > > > * > * For searches and help try: > * http://www.stata.com/help.cgi?search > * http://www.stata.com/support/statalist/faq > * http://www.ats.ucla.edu/stat/stata/ > -- Dr. Florian Wakolbinger 3E - Haigner/Jenewein/Wakolbinger Amraserstrasse 15 6020 Innsbruck www.drei-e.at +43 (0)664 638 5993 * * For searches and help try: * http://www.stata.com/help.cgi?search * http://www.stata.com/support/statalist/faq * http://www.ats.ucla.edu/stat/stata/ * * For searches and help try: * http://www.stata.com/help.cgi?search * http://www.stata.com/support/statalist/faq * http://www.ats.ucla.edu/stat/stata/ * * For searches and help try: * http://www.stata.com/help.cgi?search * http://www.stata.com/support/statalist/faq * http://www.ats.ucla.edu/stat/stata/

**References**:**st: frequency bar charts of string variables***From:*Florian Wakolbinger <wakolbinger@drei-e.at>

**st: RE: frequency bar charts of string variables***From:*"Nick Cox" <n.j.cox@durham.ac.uk>

**Re: st: RE: frequency bar charts of string variables***From:*Florian Wakolbinger <wakolbinger@drei-e.at>

**RE: st: RE: frequency bar charts of string variables***From:*"Martin Weiss" <martin.weiss1@gmx.de>

- Prev by Date:
**st: RE: RE: RE: Covariates in model** - Next by Date:
**Re: st: nlogit and no within-group variation [Stata 8]** - Previous by thread:
**Re: st: RE: frequency bar charts of string variables** - Next by thread:
**st: CI to SE** - Index(es):

© Copyright 1996–2016 StataCorp LP | Terms of use | Privacy | Contact us | What's new | Site index |