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

st: RE: Graph question


From   "Nick Cox" <[email protected]>
To   <[email protected]>
Subject   st: RE: Graph question
Date   Wed, 22 Jan 2003 19:40:07 -0000

Ronnie Babigumira

> Basic graphics question I cant seem to figure out (I am 
> using stata 7 on
> win2k). I have household data (sample below)
> 
>          houscode   npract00   npract90
>   1.     12110001          0          0
>   2.     12110002          0          0
>   3.     12110003          1          1
>   4.     12401001          1          0
>   5.     12401002          0          0
>   6.     12401003          6          2
>   7.     12403001          0          0
>   8.     12403002          0          0
>   9.     12403003          1          0
> 
> Where npracts00 npracts90 are number of practices (2000 and 
> 1990 resptively
> and run from 0 - 6). To get the percentages of households 
> in the diffrent
> practice classes for 2000, I tabulate npract00.
> 
> I would like to represent this information graphically 
> where on on the x
> axis I have practices and on y I have percentage. However, 
> I want the bars
> for 2000 and 1990 for O practices to be side by side and so 
> forth (so it is
> clear to see if there was a change between the two years). 

Or perhaps frequency polygons, overlaid: 

 rename npract00 npract2000 
 rename npract90 npract1990
 reshape long npract , i(houscode) j(year) 
 contract npract year , zero
 egen percent = pc(_freq), by(year)
 separate percent , by(y) 
 graph percent???? npract , c(ll) sort

Nick 
[email protected] 
*
*   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