Bookmark and Share

Notice: On April 23, 2014, Statalist moved from an email list to a forum, based at

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

Re: st: serrbar command

From   Nick Cox <>
To   "" <>
Subject   Re: st: serrbar command
Date   Sat, 27 Apr 2013 18:23:03 +0100

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 <> 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,
> Fatma,
> *
> *   For searches and help try:
> *
> *
> *
*   For searches and help try:

© Copyright 1996–2017 StataCorp LLC   |   Terms of use   |   Privacy   |   Contact us   |   Site index