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: RE: Adding a text to a histogram


From   Nick Cox <njcoxstata@gmail.com>
To   "statalist@hsphsun2.harvard.edu" <statalist@hsphsun2.harvard.edu>
Subject   Re: st: RE: Adding a text to a histogram
Date   Sun, 26 May 2013 07:27:30 +0100

This code depends on r(mean) being defined when you call -histogram-,
which in turn depends on the results of -summarize- being accessible
(or, more generally, the results of any command that leaves r(mean) in
its wake). So, test that by

. display r(mean)

to see what is there, just before the -histogram- call.

Nick
njcoxstata@gmail.com


On 25 May 2013 22:26, menteith <menteith@o2.pl> wrote:
> I managed to get something like this:
>
> histogram longevity, bin(10) frequency fcolor(gs14) lcolor(white) normal normopts(lcolor(black)) ytitle(Częstotliwość) ylabel(, angle(horizontal)) xlabel(#5, format(%9.0g)) graphregion(color(white)) bgcolor(white) text(4 4 "średnia`=string(`=r(mean)',"%8.2f")'", placement(right))
>
> but it does not show calculated mean. Why?

*
*   For searches and help try:
*   http://www.stata.com/help.cgi?search
*   http://www.stata.com/support/faqs/resources/statalist-faq/
*   http://www.ats.ucla.edu/stat/stata/


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