Notice: On April 23, 2014, Statalist moved from an email list to a forum, based at statalist.org.
From | Grace Jessie <gracejessie@hotmail.com> |
To | <statalist@hsphsun2.harvard.edu> |
Subject | RE: st: variable format |
Date | Sat, 19 Mar 2011 05:05:11 +0000 |
Nick, thank you again! Grace ---------------------------------------- > Date: Fri, 18 Mar 2011 09:24:06 +0000 > Subject: Re: st: variable format > From: njcoxstata@gmail.com > To: statalist@hsphsun2.harvard.edu > > 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 : > > > > 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/ * * 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/