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 <waddell@OREGON.UOREGON.EDU>
To   Statalist <>
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

*   For searches and help try:

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