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]

st: RE: problem using local


From   Nick Cox <[email protected]>
To   "'[email protected]'" <[email protected]>
Subject   st: RE: problem using local
Date   Thu, 14 Jun 2012 13:17:53 +0100

My guess is that one of your names is already in use deep deep down in Stata's graph code, so there is a clash. I guessed -lrscale- but I couldn't reproduce your problem. 

Nick 
[email protected] 

Viktor Emonds

I am trying to write a code for a simple loop of graphs, which I would then like to combine. The idea is to specify graphs for a number of variables I specified in a local, save them under the same name and then combine them by again calling the local with graph combine after the loop. Curiously, sometimes my current code works and sometimes the last line gives me an error (r 4027, incompatible types, may not assign class to double) in Stata 11. Any ideas?

local iv age female hinctnta eduyrs polintr lrscale
foreach var of local iv {
twoway (scatter poltrst `var') (lfit poltrst `var') (lowess poltrst `var'), name(`var') nodraw
}
graph combine `iv', name(poltrst)


*
*   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–2018 StataCorp LLC   |   Terms of use   |   Privacy   |   Contact us   |   Site index