From | Gary Longton <[email protected]> |
To | [email protected] |
Subject | Re: st: change case of variable names |
Date | Mon, 01 Aug 2005 13:50:26 -0700 |
Lachenbruch, Peter wrote:
I have a data set with about 600 variables and all are in upper case. Is there a simple way to make the case lower?This looks like the right idea to me - one minor problem is that rename won't take an expression for the second argument, though you can get around this with the expression expansion operator `=exp'. Also, within the string function, lower(), enclose `v' in double quotes so that lower() is evaluating the variable name and not the variable itself.
I played with ren ARM lower("ARM") that didn't work. I suspect I'm missing something very obvious. What I'd eventually like to do is something like
foreach v of varlist A-Z{
ren `v' lower(`v')
}
but that won't work.
© Copyright 1996–2024 StataCorp LLC | Terms of use | Privacy | Contact us | What's new | Site index |