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: bar graph axis color- frustrated


From   Scott Merryman <scott.merryman@gmail.com>
To   statalist@hsphsun2.harvard.edu
Subject   Re: st: bar graph axis color- frustrated
Date   Fri, 11 Jun 2010 10:33:19 -0500

A result like this?

sysuse auto,clear
local i = 1
foreach var of varlist mpg head turn gear  {
	local l`var' : var label `var'
	local a " `a' `i' `"`l`var''"' "
	local ++i
}
collapse mpg head turn gear,  by(fore)
stack mpg head turn gear, into(a) clear
label def _stack `a'
label val _stack _stack
bys _s: gen origin = _n -1
reshape wide a, i(_s) j(origin)
label var a0 "Domestic"
label var a1 "Foreign"
graph dot (asis) a*,  over(_s)


Scott


On Fri, Jun 11, 2010 at 8:16 AM, Fred Wolfe
<fwolfe@arthritis-research.org> wrote:
> I hope I can explain it it. First, let me say that I think I can
> figure out ways to do this by reorganizing the data. But the time
> involved in doing this is (at least for me) too long.
>
> Consider the example below:
> http://screencast.com/t/NjUwNmE3YTMt
>
> This is a special case of a general problem. Special because in this
> instance it is a results data set that was made by copying results
> from Stata to a new data set.
>
> In this instance, each named line represents a different variable. The
> code for one side of the graph is:
>
>   use raoadotplotdata, clear
>   graph dot (asis) age - all ,ascat ylab(.5 [.1] 1) exclude0
> schem(bw) ytit(Concordance coefficient) xsize(4) ysize(5.3)
> by(type,note(""))
>
> Now, what I would really like to be able to do is to not use "by" and
> have both types of symbols (RA and OA) be displayed on each line. If I
> simply do over(), the groups are placed far apart.
>

*
*   For searches and help try:
*   http://www.stata.com/help.cgi?search
*   http://www.stata.com/support/statalist/faq
*   http://www.ats.ucla.edu/stat/stata/


© Copyright 1996–2014 StataCorp LP   |   Terms of use   |   Privacy   |   Contact us   |   Site index