Stata The Stata listserver
[Date Prev][Date Next][Thread Prev][Thread Next][Date index][Thread index]

st: RE: Graphing a categorical variable: simple bar chart.


From   "Yaojun Li" <[email protected]>
To   <[email protected]>
Subject   st: RE: Graphing a categorical variable: simple bar chart.
Date   Mon, 17 Nov 2003 18:07:28 -0000

Dear Wendy,

Suppose you have a variable on class with four categories:


. tab rcl4

          Class |      Freq.     Percent        Cum.
----------------+-----------------------------------
       SV(I+II) |       4355       29.96       29.96
         PB(IV) |       1062        7.31       37.27
    INT(IIIa+V) |       3169       21.80       59.07
WC(IIIb VI VII) |       5950       40.93      100.00
----------------+-----------------------------------
          Total |      14536      100.00

You need to put it into dummies to put into bars.

tab rcl4,g(class)


Then you can graph it:
graph class*,bar

Hope that this helps.

Best wishes

Your yaojun

-----Original Message-----
From: wendy olsen [mailto:[email protected]] 
Sent: 17 November 2003 17:46
To: [email protected]
Subject: st: Graphing a categorical variable: simple bar chart.

Dear STATA,
Are we daft or just uninformed?  How do we use the Menus to 
make a simple univariate bar chart of %s?

We can't make a chart of counts either using Graphics / 
Easygraphs / Bar / and put in one variable in the dialog box.

If someone could send us the equivalent syntax for a simple bar 
chart we';ll be grateful, but for teaching purposes we need a Menu 
option.
Yours
Wendy and others at CCSR



Wendy Olsen
Lecturer in Socio-Economic Research
Cathie Marsh Centre for Census & Survey Research
University of Manchester
Manchester M13 9PL
0044-161-275-3043
*
*   For searches and help try:
*   http://www.stata.com/support/faqs/res/findit.html
*   http://www.stata.com/support/statalist/faq
*   http://www.ats.ucla.edu/stat/stata/

*
*   For searches and help try:
*   http://www.stata.com/support/faqs/res/findit.html
*   http://www.stata.com/support/statalist/faq
*   http://www.ats.ucla.edu/stat/stata/



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