[Date Prev][Date Next][Thread Prev][Thread Next][Date index][Thread index]

Re: Re: st: tabulate and graph bar

From   n j cox <>
Subject   Re: Re: st: tabulate and graph bar
Date   Tue, 27 May 2008 15:10:08 +0100

This may look like the obvious answer, but I don't think it is what is best here.

I guess Pål wants to see bar graphs of category frequencies or percents for one-, two- or three-way tables.

You can get useful results with a trick

gen frequency = 1
graph bar (sum) frequency, over(frog) over(toad)

once we recall that counting is adding 1s as many times as is needed.

But it is a small pain to extend this even to simple percent calculations. So, as a convenience, there are various user-written programs, of which -catplot-, -tabplot- and -spineplot- spring to mind.

-search- using these program names for program locations and documentation, including various pieces in the Stata Journal from 2004 and 2008.


Maarten Buis

--- Pål Rønning <> wrote:
> What is the easiest way of creating bar graphs of categorical data
> containing several categories? Sofar I havent found an option to
> graph after a tab command-does one exist?

-help graph bar-

* For searches and help try:

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