Announcement

Collapse
No announcement yet.
X
  • Filter
  • Time
  • Show
Clear All
new posts

  • renvars command

    Hi,

    I am trying to run the renvars command but it keeps on giving me a particular error.
    Command: renvars PERSONID yrssch Age inhh, prefix(FATHER)

    Error: command renvars is unrecognized

  • #2
    first, -renvars- is a user-written command that must be downloaded; second, however, it has been superseded by upgrades to the official -rename- command; in particular, see
    Code:
    help rename group
    if you happen to have a vey old copy of Stata you might need to use -renvars-; in that case, use -search- to find and download

    Comment


    • #3
      Rich Goldstein is right. Let's note how to solve your problem otherwise.

      In Stata, typing

      Code:
      search renvars
      finds, among yet other commands that use or extend renvars, the original files:

      dm88_1 from http://www.stata-journal.com/software/sj5-4
      SJ5-4 dm88_1. Update: Renaming variables, multiply and... / Update:
      Renaming variables, multiply and systematically / by Nicholas J. Cox,
      Durham University, UK / Jeroen Weesie, Utrecht University, Netherlands /
      Support: [email protected], [email protected] / After installation,

      dm88 from http://www.stata.com/stb/stb60
      STB-60 dm88. Renaming variables, multiply and systematically / STB insert
      by Nicholas J. Cox, University of Durham, UK / Jeroen Weesie, Utrecht
      University, Netherlands / Support: [email protected]
      [email protected] / After installation, see help renvars

      So
      renvars was first published in STB 60 in 2001 https://www.stata.com/products/stb/journals/stb60.pdf and updated in Stata Journal in 2005.

      But StataCorp revised rename in Stata 12 in July 2011. So renvars had a decade of being possibly useful.

      The only reason to learn renvars now is because you are on Stata 11 or earlier. (Note that you are asked to tell is if you are not using the latest Stata version.)

      Otherwise the only reason to use
      renvars now is because you have been passed old code by someone who used it, but you still need to install the program before you can use it -- and advise people who read or use your code of the need to do that.

      In July 2011, as the first author of
      renvars, I resolved to go through the syntax and document the translation to and from the extended rename, including any offlap, but i am still waiting for myself to do that, and somehow it has lost its point.

      That said, the translation here is simple:

      Code:
      renvars PERSONID yrssch Age inhh, prefix(FATHER)
      
      rename (PERSONID yrssch Age inhh) FATHER=


      In practice
      FATHER as suffix is likely to be more convenient.







      Comment


      • #4
        It seems to me that rename does not currently provide all the functionalities of renvars, does it? For example something like:

        Code:
        renvars _all, subst("å" "a")

        Comment


        • #5
          I am prepared (indeed, would be amused) to find the general statement in #4 to be true, but this example is unconvincing:


          .
          Code:
           sysuse auto, clear
          (1978 automobile data)
          
          . gen teståsomething = 42
          
          . rename (*å*) (*a*)
          
          . ds
          make          mpg           headroom      weight        turn          gear_ratio    testasomet~g
          price         rep78         trunk         length        displacement  foreign
          
          .

          While I fondly imagine that the existence of renvars was a minor spur to the extensive additions to rename in Stata 12, the bigger spur was just that users wanted much more functionality in renaming. Either way, rename wasn't rewritten with any idea of cloning the syntax of renvars, and quite rightly too.,


          Comment

          Working...
          X