# Re: st: macro and twoway graph

 From Maarten buis To statalist@hsphsun2.harvard.edu Subject Re: st: macro and twoway graph Date Thu, 25 Jun 2009 16:51:28 +0000 (GMT)

```This example works:

*------------- begin example -----------
drop _all
set obs 500
gen r=_n
gen t=runiform()
egen q=mean(t)

local r "(line t r, sort)"
local y "(line q r,sort)"

local m `y' `r'

tw `m'
*-------------- end example ------------

-- Maarten

-----------------------------------------
Maarten L. Buis
Institut fuer Soziologie
Universitaet Tuebingen
Wilhelmstrasse 36
72074 Tuebingen
Germany

http://home.fsw.vu.nl/m.buis/
-----------------------------------------

--- On Thu, 25/6/09, moleps islon <moleps2@gmail.com> wrote:

> From: moleps islon <moleps2@gmail.com>
> Subject: st: macro and twoway graph
> To: statalist@hsphsun2.harvard.edu
> Date: Thursday, 25 June, 2009, 4:55 PM
> Dear listers,
> For some reason I cannot respond to responses to my posting
> yesterday.
> Bare with me if the responses appear later.
>
> I´ve rephrased the problem that I cannot come to grips
> with.
>
> set obs 500
> gen r=_n
> gen t=runiform()
> egen q=mean(t)
>
>
> tw (line t r, sort) (line q r,sort)-->works fine
>
> local r="(line t r, sort)"
> local y="(line q r,sort)"
>
> . di "`y'"
> (line q r,sort)
>
> . di "`r'"
> (line t r, sort)
>
> . local m "`y' " "`r'"
>
> . di "`m'"
> (line q r,sort) (line t r, sort)
>
> . tw "`m'"
> line        ( is not a twoway plot
> type
> r(198);
>
>
> What is the correct positioning of the " ´ and `in this
> problem???
>
> Moleps
>
> *
> *   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/
```