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


From   Sergiy Radyakin <[email protected]>
To   "[email protected]" <[email protected]>
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.
<[email protected]> 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
> [email protected]
> 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–2018 StataCorp LLC   |   Terms of use   |   Privacy   |   Contact us   |   Site index