Statalist The Stata Listserver


[Date Prev][Date Next][Thread Prev][Thread Next][Date index][Thread index]

st: RE: renvars


From   "Nick Cox" <[email protected]>
To   <[email protected]>
Subject   st: RE: renvars
Date   Wed, 19 Apr 2006 15:20:20 +0100

You are using an out-of-date -renvars-. If I 

. findit renvars 

I get, modulo duplicates, 

SJ-5-4  dm88_1  . . . . . . . . . . . . . . . . .  Software update for renvars
        (help renvars if installed) . . . . . . . . .  N. J. Cox and J. Weesie
        Q4/05   SJ 5(4):607
        trimend() option added and help file updated

STB-60  dm88  . . . . . . . .  Renaming variables, multiply and systematically
        (help renvars if installed) . . . . . . . . .  N. J. Cox and J. Weesie
        3/01    pp.4--6; STB Reprints Vol 10, pp.41--44
        renames variables by changing prefixes, postfixes, substrings,
        or as specified by a user supplied rule

renvars from http://www.fss.uu.nl/soc/iscore/stata
    renvars.  Powerful command to rename variables. / renvars renames the
    variables in a varlist by any of a number of / functions, case conversion,
    pre- and postfixing of strings, and / substitutions within variable names.
    / Author:  Jeroen Weesie, Dept of Sociology, Utrecht University (NL) /

Which one to use? 

That in dm88_1 evidently updates dm88. Also, dm88_1 turns out to need 
Stata 8, which is OK for Rijo John. What about the copy 
on Jeroen Weesie's website, which is the one Rijo John installed? Stata 
can tell you more about that. Just -type- the file out (realise how
useful Stata's internet capabilities are!) 

. type http://www.fss.uu.nl/soc/iscore/stata/renvars.ado 

The output starts 

*! 2.2.1  15aug2000  Jeroen Weesie/ICS
program define renvars
        version 6

        syntax [varlist] [, Upcase Lowcase /*
        */ PREFix(str) POSTFix(str) PRESub(str) POSTSub(str) SUBst(str) /*
        */ PREDrop(int 0) POSTDrop(int 0) Trim(int 8) /*
        */ Fast Display ]

...

and this alone indicates (1) this is an older version of -renvars- 
(2) from the -syntax- alone, this version won't support the syntax 
Rijo John is using (which is undocumented, but that's another detail). 

So, why is Jeroen keeping an older version on his website? There are
at least three good answers to this: 

0. People are busy! 

1. Ask Jeroen!

2. Older versions are useful to users of older versions of Stata. 
For example, if I updated -renvars- and made the use of Stata 9 
compulsory, then Rijo John would be out of luck, or obliged to 
buy an upgrade to Stata 9 (a good idea, anyway, but that's incidental). 
Holding older versions thus harms nobody and helps somebody. 

Nick 
[email protected] 

Rijo John
 
> I use to run this command  --renvars bihar gujarat haryana karnataka
> kerala  / st1-st5-- to rename the 5 states into st1 to st5
> respectively and it use to run without any problem. I use stata 8.2.
> However, recently I had to reinstall Stata in my machine and had to
> install the renvars ado files again (from
> http://www.fss.uu.nl/soc/iscore/stata). Now when I execute the same
> command it tells me
> 
> . renvars bihar gujarat haryana karnataka kerala  / st1-st5
> / invalid name
> r(198);
> 
> Hence I had to take an alternative root to get my work done 
> as follows.
> 
> local i=1
> foreach var of varlist bihar gujarat haryana karnataka kerala {
> ren `var' st`i'
> local i=`i'+1
> }
> 
> 
> Can anyone tell me why -renvars- is not doing now what it use 
> to do before?

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