Statalist


[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

st: display a local macro mixing text and numbers


From   Jacob Wegelin <[email protected]>
To   [email protected]
Subject   st: display a local macro mixing text and numbers
Date   Mon, 5 Jan 2009 17:41:14 -0500 (EST)


In the code below, why does Stata return an error?  I run into this kind of problem repeatedly.  Although I have explicitly told Stata to include "99" as a string in the macro, Stata appears to get confused.

. local junk "99"

. di `junk'
99

. di "`junk'"
99

. . local junk 5 99 oops 4.4

. di "junk is " "`junk'"
junk is 5 99 oops 4.4

. local junk 5 "99" oops 4.4

. di "junk is " "`junk'"
junk is 5 4" invalid name
r(198);

Thanks for any enlightenment.

Jacob A. Wegelin
Assistant Professor
Department of Biostatistics
Virginia Commonwealth University
730 East Broad Street Room 3006
P. O. Box 980032
Richmond VA 23298-0032



© Copyright 1996–2024 StataCorp LLC   |   Terms of use   |   Privacy   |   Contact us   |   What's new   |   Site index