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: creating a bar chart with overlayed symbols


From   Sergiy Radyakin <serjradyakin@gmail.com>
To   "statalist@hsphsun2.harvard.edu" <statalist@hsphsun2.harvard.edu>
Subject   Re: st: creating a bar chart with overlayed symbols
Date   Fri, 21 Jun 2013 12:00:59 -0400

Walt, I still can't visualize exactly what you want to obtain. But
here is something to play with. Sergiy

sysuse auto, clear
keep if rep78>2
label define lrep78 3 "Feature A" 4 "Feature B" 5 "Feature C"
label values rep78 lrep78

separate price, by(foreign)
collapse (mean) price (mean) weight, by(rep78 foreign)
label variable price "Average price"
label variable weight "Importance of feature"
label variable foreign "Car origin"

twoway bar price foreign, by(rep78, rows(1)) fc(teal) lc(teal) ///
       yscale(r(0(1000)8000)) ///
       xlabel(0 "domestic" 1 "foreign") ||  ///
       scatter weight foreign if foreign==0, by(rep78) ms(T) mc(red) || ///
       scatter weight foreign if foreign==1, by(rep78) ms(S) mc(green) ///
       legend(rows(1))

On Fri, Jun 21, 2013 at 8:31 AM, Data Analytics Corp.
<walt@dataanalyticscorp.com> wrote:
> Hi,
>
> Thanks for the suggestion.  I started to head in that direction. Now to do
> it.
>
>
> Thanks,
>
> Walt
>
> ________________________
>
> Walter R. Paczkowski, Ph.D.
> Data Analytics Corp.
> 44 Hamilton Lane
> Plainsboro, NJ 08536
> ________________________
> (V) 609-936-8999
> (F) 609-936-3733
> walt@dataanalyticscorp.com
> www.dataanalyticscorp.com
> _____________________________________________________
>
>
> On 6/21/2013 4:57 AM, Nick Cox wrote:
>>
>> You need to translate your problem to -twoway-, e.g.  -twoway bar-
>> Then overlaid symbols are just a -scatter- or -scatteri- on top.
>> *
>> *   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–2014 StataCorp LP   |   Terms of use   |   Privacy   |   Contact us   |   Site index