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: serrbar command
Nick Cox <firstname.lastname@example.org>
Re: st: serrbar command
Sat, 27 Apr 2013 18:33:40 +0100
With -serrbar- you could use a loosely similar technique to that
below, namely define a numeric axis and then assign the country names
as value labels. But -serrbar- has wired in that mean +/- error is
plotted vertically and the other axis horizontally. So, the country
names would still be on the less convenient axis.
On 27 April 2013 18:23, Nick Cox <email@example.com> wrote:
> If that were my problem, I wouldn't use -serrbar- at all. You could
> use marker labels, but there would no guarantees about readability or
> friendliness of display.
> This example shows some technique. I used some real data, but faked
> standard errors. -labmask- is from SJ and must be installed first. See
> my 2008 article for much more. It doesn't touch on your precise kind
> of graph, but otherwise I think it is pertinent. It's free as a .pdf
> sysuse lifeexp, clear
> l country in 1/10
> gen upper = lexp + 2.4
> gen lower = lexp - 2.4
> gen axis = _n
> labmask axis, values(country)
> * next 3 lines are all one command: omit /// interactively
> scatter axis lexp in 1/10 || ///
> rcap lower upper axis in 1/10, horizontal yla(1/10, noticks valuelabel
> ang(h)) ///
> ysc(reverse) ytitle("") legend(off) xtitle(`: var label lexp')
> 1. The example graph uses alphabetical ordering by countries, which is
> not usually a good idea. It's usually better to choose another order,
> e.g. to -sort- by means first.
> 2. I'm the putative author of -serrbar-, because I rewrote it many
> years ago, but it's not nearly versatile enough to do well what you
> are likely to want. I feel no conflict of interest in diverting you
> away from a command not much use to you really.
> On 27 April 2013 17:44, Fatma Romeh <firstname.lastname@example.org> wrote:
>> Dear statalist,
>> I want to graph standard error using the command "serrbar". I have ten countries with an average and ten standard errors. My question is how can I put the country names on the graph?
>> Many thanks,
>> * 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/
* For searches and help try: