I use Stata 8.2 and built up a long macro in a loop. The macro is not
accepted by the -twoway- command and instead I get a "type mismatch
r(109);" error message. The problem can be reproduced with the auto
dataset.
. sysuse auto
. local scatter "(scatter mpg weight if make=="VW Diesel",
connect(l)) (scatter mpg weight if make=="AMC Pacer", connect(l))"
. twoway `"`scatter'"'
type mismatch
r(109);
It is possible to display the contents of the macro.
. di `"`scatter'"'
(scatter mpg weight if make=="VW Diesel", connect(l)) (scatter mpg
weight if make=="AMC Pacer", connect(l))
It is also possible to draw the graph by typing the complete -twoway-
command.
. twoway (scatter mpg weight if make=="VW Diesel", connect(l))
(scatter mpg weight if make=="AMC Pacer", connect(l))
Why does the macro not work with -twoway-? Can the problem be solved
by adding more quotes somewhere?
Friedrich
____________________________________________________________________________________
Sponsored Link
Mortgage rates near 39yr lows.
$420k for $1,399/mo. Calculate new payment!
www.LowerMyBills.com/lre
*
* For searches and help try:
* http://www.stata.com/support/faqs/res/findit.html
* http://www.stata.com/support/statalist/faq
* http://www.ats.ucla.edu/stat/stata/