Stata The Stata listserver
[Date Prev][Date Next][Thread Prev][Thread Next][Date index][Thread index]

st: identifying letters in a string variable


From   TEWODAJ MOGUES <tmogues@students.wisc.edu>
To   Stata _ <statalist@hsphsun2.harvard.edu>
Subject   st: identifying letters in a string variable
Date   Wed, 31 Aug 2005 18:48:24 -0400

Hello list,
I looked through the string functions to try to find out which variable 
values of a string variable has letters plus numbers, only letters, and 
only numbers, but didn't come up with anything. E.g. suppose i wanted 
to create a categorical variable that takes on 1 when stringvar has 
only numbers, 2 if a mix of numbers and letter, and 3 if only letters:

stringvar catvar
1           1
12          1
id14        2
run         3
5K          2
SPRINT      3 

Is there a way to do this?
thanks,
tewodaj
*
*   For searches and help try:
*   http://www.stata.com/support/faqs/res/findit.html
*   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   |   What's new   |   Site index