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

st: Better way to -graph- -tabulate varname1 varname2, column nofreq- (can't find better way in manual)


From   "Renzo Comolli" <[email protected]>
To   <[email protected]>
Subject   st: Better way to -graph- -tabulate varname1 varname2, column nofreq- (can't find better way in manual)
Date   Sun, 28 Dec 2003 01:22:37 -0500

Dears,

I am a newbie as far as graphing is concerned. I read (what seems
appropriate of) the [G] manual and I found a way to do what I want, but it
is quite cumbersome. I believe there must be a better way. I would be
grateful for any suggestion, or just the page in the manual.

Here is a (made up) example
. webuse gss1991
. gen agebin=int(age/10)
. tab happy agebin, colum nofreq


      general |                                         agebin
    happiness |         1          2          3          4          5
6          7          8 |     Total
--------------+-------------------------------------------------------------
---------------------------+----------
   very happy |      9.09      27.24      30.37      32.97      30.06
35.50      33.11      34.92 |     31.09 
 pretty happy |     90.91      63.79      58.12      53.62      60.12
54.44      54.73      55.56 |     57.99 
not too happy |      0.00       8.97      11.52      13.41       9.82
10.06      12.16       9.52 |     10.92 
--------------+-------------------------------------------------------------
---------------------------+----------
        Total |    100.00     100.00     100.00     100.00     100.00
100.00     100.00     100.00 |    100.00 


I would like a graph with agebin as X variable and each "very happy",
"pretty happy", "not too happy" as different Y variables.




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