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]

Re: st: serrbar command


From   Nick Cox <njcoxstata@gmail.com>
To   "statalist@hsphsun2.harvard.edu" <statalist@hsphsun2.harvard.edu>
Subject   Re: st: serrbar command
Date   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.

Nick
njcoxstata@gmail.com


On 27 April 2013 18:23, Nick Cox <njcoxstata@gmail.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
> at
>
> http://www.stata-journal.com/sjpdf.html?articlenum=gr0034
>
> 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')
>
> Disclaimers:
>
> 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.
> Nick
> njcoxstata@gmail.com
>
>
> On 27 April 2013 17:44, Fatma Romeh <fromeh1@student.gsu.edu> 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:
>> *   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:
*   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