Statalist


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

st: graph bar and/or catplot


From   "b. water" <barleywater@hotmail.com>
To   <statalist@hsphsun2.harvard.edu>
Subject   st: graph bar and/or catplot
Date   Sun, 28 Sep 2008 23:22:06 +0000


dear all,

stata 8.2,

my data set-up look something like this:

subject laser1  laser2
1       1       2
2       2       1
3       3       3
4       2       4
5       3       1
.       .       .
.       .       .
.       .       .
.       .       .
.       .       .
316     4       1

there were 316 subjects. laser1 has categories which take the values of 1 to 5 but returns from the subjects showed only categories 1 to 4 i.e. none of the subejct reported 5, likewise with laser2. i want to create a graph ala [G] page 134 of Stata 8 [G]raphic manual, where the y-axis would show the total count of the subjects for each category while x-axis would show categories 1 to 5, with the chart itself consisting of two bars of different colors for each laser1 and laser2.

i tried various gr bar commands but just couldn't produce the kind of graphs that i want. using catplot e.g.:

catplot bar laser1 laser2, asyvars

came close but somehow it is showing 3 bars in some categories when it should only be showing two bars i.e. one for each laser1 and laser2 respectively. the other thing is i also want to show on the graph is category 5 (i.e. value of 5) on the x-axis albeit it'll be empty i.e. 0, but where in using the above command, only 1 to 4 in the x-axis was displayed.

i would appreciate any advice/help either using the gr bar route or the catplot route or both to achieve what i wanted to show.

thank you,
bw
_________________________________________________________________
Want to do more with Windows Live? Learn “10 hidden secrets” from Jamie.
http://windowslive.com/connect/post/jamiethomson.spaces.live.com-Blog-cns!550F681DAD532637!5295.entry?ocid=TXT_TAGLM_WL_domore_092008
*
*   For searches and help try:
*   http://www.stata.com/help.cgi?search
*   http://www.stata.com/support/statalist/faq
*   http://www.ats.ucla.edu/stat/stata/



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