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

st: RE: Variable name


From   "Nick Cox" <[email protected]>
To   <[email protected]>
Subject   st: RE: Variable name
Date   Wed, 22 Jan 2003 10:06:51 -0000

Jitian Sheu

> when we create variables, a variable with name, say, "X"
> (capital X), is
> different with a variable with name, "x" (normal one).
> I am wondering whether there is any other method that can make Stata
> temporary insensitive to "X" and "x"?

Without knowing context, it is difficult to know what kind
of answer you most want.

I can imagine setting up a program in which if
a supposed variable did not exist, the program tried
an upper-cased or lower-cased version of that name.
On the whole, I think such DWIM (Do What I Mean)
solutions would be a bad idea for interacting
with software like Stata. Be that as it may,
there is a cautionary tale at
http://www.clueless.com/jargon3.0.0/DWIM.html

By and large, it is best to take Stata's
case-sensitivity as a fact of life and adapt to it.
It is a feature, on the whole.

My experience also is that it is easiest
to interact with Stata when (almost all)
variables have (almost all) lower case names,
although that's partly a matter of taste.

Thus if some variable names cause problems, then
consider a renaming. Some tools beyond -rename-
are -renpfix-, -rensfix- (STB-59), -renvars-
(STB-60), -varcase- (SSC).

Nick
[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