From | David Kantor <[email protected]> |
To | [email protected] |
Subject | Re: st: renaming a variable from the contents of its observation |
Date | Thu, 01 Jul 2004 09:52:23 -0400 |
At 02:36 PM 7/1/2004 +0100, Dev Vencappa wrote:
Dear allPresumably these variables are all of string type -- as seen by the contents of the first observation. Thus, even though there are values 4108, 4103, etc. in the 2nd observation, they are really string values. Then you can do this (untested):
I have a large data set containing variables v9 to v200.
variable names: v9 v10 v11 v12 v13 v14 ........ ..... v200
Observation 1 TAN TAN TAL TAN CAN TLM
Observation 2 4108 4103 4108 5214 1235 1108
Each of these numbers in the second row of observations represents a particular variable code. What I want is to prefix each of these numbers with the text in the first row of observation e.g. TAN4108 TAN4103 CAN1235 TLM1108, etc. After that, I want to rename my existing variables (v9,v10,v11,...-v126) to these newly created variables.
© Copyright 1996–2024 StataCorp LLC | Terms of use | Privacy | Contact us | What's new | Site index |