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: variable format
From
Nick Cox <[email protected]>
To
[email protected]
Subject
Re: st: variable format
Date
Fri, 18 Mar 2011 09:24:06 +0000
You'd need to do this in advance of the -graph- command. That is, the
values or value labels of the -by()- variable would need to include
whatever text you want. Here the main technique is exactly as
explained to you in another thread.
set obs 4
gen u = uniform()
expand 10
gen y = rnormal()
gen x = y+rnormal()
gen sru = "original " + string(u, "%2.1f")
scatter y x,by(sru)
Other cases could involve defining value labels, or fixing ad hoc in
the Graphics Editor.
Nick
2011/3/18 Grace Jessie <[email protected]>:
>
> The link you provided seems to solve the problem with only one constant to display as someone likes.
> In the posting, Al Feiveson's graph is repeated by subgroups, which results in different values in subgroups. How to invoke the macro with by option (i.e., different subgroups) within the graph command?
>
> What Al Feiveson takes for example is as follows.
>
> set obs 4
> gen u = uniform()
> gen ru = round(u,.01)
> expand 10
> gen y = rnormal()
> gen x = y+rnormal()
> scatter y x,by(ru)
>
*
* 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/