Bookmark and Share

Notice: On March 31, it was announced that Statalist is moving from an email list to a forum. The old list will shut down on April 23, and its replacement, statalist.org is already up and running.


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

RE: SV: st: value labels, rename and merge


From   "Lachenbruch, Peter" <Peter.Lachenbruch@oregonstate.edu>
To   "'statalist@hsphsun2.harvard.edu'" <statalist@hsphsun2.harvard.edu>
Subject   RE: SV: st: value labels, rename and merge
Date   Tue, 13 Apr 2010 09:07:52 -0700

I asked a similar question a few weeks ago and got the renvars command.  It's a miracle worker - use it in good health and thank the author.

Tony

Peter A. Lachenbruch
Department of Public Health
Oregon State University
Corvallis, OR 97330
Phone: 541-737-3832
FAX: 541-737-4001


-----Original Message-----
From: owner-statalist@hsphsun2.harvard.edu [mailto:owner-statalist@hsphsun2.harvard.edu] On Behalf Of Nick Cox
Sent: Tuesday, April 13, 2010 8:05 AM
To: statalist@hsphsun2.harvard.edu
Subject: RE: SV: st: value labels, rename and merge

-renvars- from SJ offers various devices for renaming. 

Nick 
n.j.cox@durham.ac.uk 

Tomas Lind

The variable names and the example I gave was I bit simplified. When I
tried
to manipulate your syntax to fit our specific problem I got into
trouble.

The variable names are not just: 
Q1, Q2, Q3 ... . 

They are:
id, est, dat, Q1, Q2, Q3 ... . 

I do not simply want to change to:
 w_Q1, w_Q2, w_Q3 ... . 

I want to get rid of "Q" in the names and change the names to:
id, est, dat, q12p1, q12p2, q12p3 ... .

To change your code to add q12 instead of w_ is straight forward, but to
get
rid of Q and get the loop running is more than I can achieve. Any help
is
welcome.


*
*   For searches and help try:
*   http://www.stata.com/help.cgi?search
*   http://www.stata.com/support/statalist/faq
*   http://www.ats.ucla.edu/stat/stata/

*
*   For searches and help try:
*   http://www.stata.com/help.cgi?search
*   http://www.stata.com/support/statalist/faq
*   http://www.ats.ucla.edu/stat/stata/


© Copyright 1996–2014 StataCorp LP   |   Terms of use   |   Privacy   |   Contact us   |   Site index