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

st: Re: RE: Variable name


From   "Jitian Sheu" <[email protected]>
To   <[email protected]>
Subject   st: Re: RE: Variable name
Date   Wed, 22 Jan 2003 09:40:47 -0500

I am sorry for confusion.
In fact, my situation is as following:

I got a dataset, which I transfer it from SAS readable dataset.
After I load into Stata, each variable automatically comes with lower case
variable name.

However, In another Sas program, they use upper case write down the command
and variable names.
And when I want to use Stata to re-run it again, the easier way for me is
just to copy the variable names(independent variables) into my do-file.
But, since those variable names are by upper case, Stata can not recognize
it.

Of course, I can re-type all upper case variable name in my Stata do-file,
but it is not convienent.....

Suppose there is method that I can make Stata temporary insensitive to upper
case or lower case. (i.e. temporary let Stata treat upper case variable and
lower case variable name the same).
Then, I can just copy all independent variable list in SAS code into my
Stata do-file.

Thank you very much and have a nice day.

jitan



----- Original Message -----
From: "Nick Cox" <[email protected]>
To: <[email protected]>
Sent: Wednesday, January 22, 2003 5:06 AM
Subject: st: RE: Variable name


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

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