Statalist


[Date Prev][Date Next][Thread Prev][Thread Next][Date index][Thread index]

st: re: local=0802 vs local=802


From   Kit Baum <[email protected]>
To   [email protected]
Subject   st: re: local=0802 vs local=802
Date   Mon, 16 Jun 2008 12:39:15 -0400

< >

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/




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