Bookmark and Share

Notice: On March 31, it was announced that Statalist is moving from an email list to a forum. The old list will shut down on April 23, and its replacement, statalist.org is already up and running.


[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

st: questions about histogram


From   David Souther <davidsoutheremail@gmail.com>
To   statalist@hsphsun2.harvard.edu
Subject   st: questions about histogram
Date   Tue, 21 Sep 2010 10:23:09 -0500

<<

I'm having trouble with 2 elements in a histogram.

The first issue is that  I cannot prevent the last bin from combining
the frequency/percent of the highest x axis categories.

The second issues is that  I would like to just add labels to some of
the bins--not all of them, it's too cluttered that way.  Here's an
example script of what I'm talking about

clear
set mem 100m
sysuse auto
bys foreign: g counter = _n
tab counter for

*!! notice how there is only a frequency of 1 for the last bin at 52,
but no matter how large I make the xscale , it always combines these
last two into the last bin with width set to 1.

hist counter   , normal  addl width(1)  start(1) freq  ///
normopts(lcolor(dimgray))   xscale(range(1 100)) yscale(range(1 4)) ///
plotregion(margin(small)) graphregion(margin(vsmall))
addlabopts(mlabsize(small) mlabangle(forty_five)) ylabel(minmax)

*
*   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   |   Site index