Bookmark and Share

Notice: On April 23, 2014, Statalist moved from an email list to a forum, based at

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

st: renaming variables from first observation

From   Abhimanyu Arora <[email protected]>
To   [email protected]
Subject   st: renaming variables from first observation
Date   Thu, 25 Aug 2011 10:07:49 +0200

Good morning statalist
I would like to rename my variables var1-var14 to the corresponding
values from the first observation.
I followed the post on and
modified it for my purpose.

but I got this error

. forvalues k = 1/14  {
  2.   local newname  = var`k'[1]
  3.   ren var`k'  `newname'
  4. }

Code not allowed

Also is it posible to store the values of an observation in a macro?
Perhaps I could then use Nick Cox's -renvars-?

*   For searches and help try:

© Copyright 1996–2018 StataCorp LLC   |   Terms of use   |   Privacy   |   Contact us   |   Site index