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 at the end of May, and its replacement, statalist.org is already up and running.


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

Re: st: Performance histograms


From   Maarten Buis <maartenlbuis@gmail.com>
To   statalist@hsphsun2.harvard.edu
Subject   Re: st: Performance histograms
Date   Sun, 26 Feb 2012 10:00:15 +0100

If you want a hundered bins for a hundred observations, than you are
not binning. Instead you are probably not looking for a histrogram but
instead want to use Nick Cox's -stripplot- (see: -ssc desc
stripplot-).

*---------- begin example --------------
sysuse auto, clear
gen byte id = .
forvalues i = 1/`=_N' {
	replace id = _n == `i'
	stripplot mpg , stack separate(id) name(gr`i')
}
*----------- end example -----------------
(For more on examples I sent to the Statalist see:
http://www.maartenbuis.nl/example_faq )

Hope this helps,
Maarten


On Sun, Feb 26, 2012 at 4:52 AM, Huerta, Tim <tim.huerta@ttu.edu> wrote:
> I have 100 observations of a continuous variable - lets call it X.
>
> For each observation, I want to create a histogram of the X variable and
> then indicate in which bar that specific observation exists.
>
> I'd like to save the graph with the observation name - for instance:
> chart001
> chart002
> .
> .
> .
> chart100
>
> In excel, the graph might look like this...
> http://statalist.1588530.n2.nabble.com/file/n7318500/sample.jpg
> However, I plan to have 100 bins - so doing this 100 times, across 6
> variables would be a challenge without some efficient coding.
>
> Any ideas?
>
>
> *
> *   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/



-- 
--------------------------
Maarten L. Buis
Institut fuer Soziologie
Universitaet Tuebingen
Wilhelmstrasse 36
72074 Tuebingen
Germany


http://www.maartenbuis.nl
--------------------------

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