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: sorting boxplots on the median


From   Nikolaos Pandis <npandis@yahoo.com>
To   "statalist@hsphsun2.harvard.edu" <statalist@hsphsun2.harvard.edu>
Subject   Re: st: sorting boxplots on the median
Date   Thu, 14 Feb 2013 11:50:14 -0800 (PST)

Nick,
Many thanks!
Nick



________________________________
From: Nick Cox <njcoxstata@gmail.com>
To: statalist@hsphsun2.harvard.edu 
Sent: Thursday, February 14, 2013 9:14 PM
Subject: Re: st: sorting boxplots on the median

sysuse auto, clear
egen median = median(mpg), by(rep78)
graph box mpg, over(rep78)
graph box mpg, over(rep78, sort(median))

Nick

On Thu, Feb 14, 2013 at 6:54 PM, Nikolaos Pandis <npandis@yahoo.com> wrote:

> I am trying the following command in Stata 12.1 with the objective to sort the boxplots according to the value of the median (ascending or descending it does not matter):
>
>
> .graph box percent,over(journalno, sort(percent) descending )
>
> However, it does not work. Any advice would be appreciated.
>
> If I use:
>
>
> graph bar percent,over(journalno,  sort(percent) descending )
>
>
> it works and sorts by the value of the mean
>
*
*   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