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

Re: st: RE: frequency bar charts of string variables

From   Florian Wakolbinger <>
Subject   Re: st: RE: frequency bar charts of string variables
Date   Thu, 23 Jul 2009 08:14:28 +0200


Martin Weiss schrieb:

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))


-----Original Message-----
[] On Behalf Of Florian
Sent: Mittwoch, 22. Juli 2009 22:12
Subject: Re: st: RE: frequency bar charts of string variables

dear all,

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..."

thanks again very much for your replies,

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
. 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
. catplot hbar Foreign

For -hbar- read also -bar-, for vertical versions usually more difficult
to read. Nick
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:

Dr. Florian Wakolbinger

3E - Haigner/Jenewein/Wakolbinger
Amraserstrasse 15
6020 Innsbruck

+43 (0)664 638 5993

*   For searches and help try:

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