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

st: RE: Re: RE: Variable name


From   "Nick Cox" <[email protected]>
To   <[email protected]>
Subject   st: RE: Re: RE: Variable name
Date   Wed, 22 Jan 2003 15:39:52 -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"?

Nick Cox 

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

Jitian Sheu
 
> 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.

In addition to Friederich Huebler's suggestion, 
the renaming commands mentioned above are 
relevant here, especially -renvars-. 

. renvars , upper 

changes one way 

and 

. renvars, lower 

changes the other. 

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