Stata The Stata listserver
[Date Prev][Date Next][Thread Prev][Thread Next][Date index][Thread index]

st: Referring to a varname, leading to errors


From   Glwn Waddell <[email protected]>
To   Statalist <[email protected]>
Subject   st: Referring to a varname, leading to errors
Date   Mon, 10 Feb 2003 16:09:21 -0800

This is one of those problems that only arises out of human error.
Nonetheless, Stata is set up to allow this mistake to go unchecked.
Consider the following example...

Suppose a variable currently exists with the name "abcdefg" and one
wants to condition on a different variable, abcde, such that one runs a
command only for abcde == 1.  If abcde has not been created (i.e. human
error, the creation of this variable having been overlooked), the
command "reg y1 x1 x2 if abcde == 1" would actually be run conditional
on abcdefg == 1, not abcde == 1.  

I suppose the idea behind allowing shortened varnames is one of
convenience.  However, this seems like more trouble than it is worth.
Is there a way to toggle between allowing such shortened names and not?
A permanent fix would be even better.


____________________________________
Glen R. Waddell
Department of Economics
1285 University of Oregon
Eugene, OR  97403-1285
phone: (541) 346-1259
fax: (541) 346-1243
http://darkwing.uoregon.edu/~waddell
[email protected]


*
*   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