Bookmark and Share

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


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

Re: st: Graphing mean and median on the same plot


From   Theophilus Dapel <[email protected]>
To   Statalist <[email protected]>
Subject   Re: st: Graphing mean and median on the same plot
Date   Sun, 9 Mar 2014 13:25:25 +0000

Dear Nick, 
It worked out. Thank you so much for this.

How do I include weight if possible?
On 9 Mar 2014, at 12:27, Nick Cox <[email protected]> wrote:

> Some technique:
> 
> webuse grunfeld, clear
> 
> graph bar (mean) invest (median) invest, over(year)
> 
> graph dot (mean) invest (median) invest, over(year) ///
> legend(order(1 "mean" 2 "median")) vertical ytitle("investment")
> 
> collapse (mean) mean=invest (median) median=invest, by(year)
> 
> line mean median year
> Nick
> [email protected]
> 
> 
> On 8 March 2014 19:35, Theophilus Dapel <[email protected]> wrote:
>> Dear Contributors,
>> I'm working on stacked datasets for 5 periods separated by years.
>> How do I plot only the mean and the median on the same plot - sort of a multiple bar chart such that the years on the horrizontal axis while the mean and median values on the vertical axis.
>> 
>> Thanks,
>> Dapel
>> *
>> *   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/


*
*   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–2018 StataCorp LLC   |   Terms of use   |   Privacy   |   Contact us   |   Site index