|
[Date Prev][Date Next][Thread Prev][Thread Next][Date index][Thread index]
st: re: local=0802 vs local=802
< >
Man said
I was wondering how to successfully defining local macros beginning
with 0, since I think probably STATA automatically ignores the 0 in the
beginning of a local's expression.
my data set has following variables:
-----------
T0990802
T0991302
T0991802
T0992302
T0992802
T0993302
T0993802
T0994302
------------
I want to create new variables equal the value of 2006 subtracted by
T0990802, T0991302,... and T0994302.
I tried the following command:
------------------------------------------
local j=0802
Well, if you don't use an equals sign...
local j 0802
says that j is an alias for the string 0802. Putting an equals sign
in causes the local to be considered as an object on which you could
perform arithmetic. You don't want to do that.
Kit
Kit Baum, Boston College Economics and DIW Berlin
http://ideas.repec.org/e/pba1.html
An Introduction to Modern Econometrics Using Stata:
http://www.stata-press.com/books/imeus.html
*
* 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/