Notice: On April 23, 2014, Statalist moved from an email list to a forum, based at statalist.org.
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
st: Remove portion of a number at the end of a variable name
From
David Torres <[email protected]>
To
<[email protected]>
Subject
st: Remove portion of a number at the end of a variable name
Date
Wed, 19 Dec 2012 18:41:06 -0500
Hello, Stata experts,
I have about 260 variables with two-digit numbers (representing years) following the variable stub in the following form:
08
09
Before reshaping the data to long format, I need to get rid of the 0 between the variable stub and the year.
For instance, how can I get these variables:
yrid08
yrcampus08
testdate08
dob08
into this form:
yrid8
yrcampus8
testdate8
dob8
Thanks in advance for any help,
Diego
--
David Diego Torres, PhD
NSF SBE Postdoctoral Research Fellow
Houston Education Research Consortium
Rice University
6100 Main Street, MS-28
Houston, TX 77005
Phone: 713-348-2984
Email: ddtorres at rice dot edu
*
* For searches and help try:
* http://www.stata.com/help.cgi?search
* http://www.stata.com/support/faqs/resources/statalist-faq/
* http://www.ats.ucla.edu/stat/stata/