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

st: identifying letters in a string variable

To   Stata _ <>
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?
*   For searches and help try:

© Copyright 1996–2017 StataCorp LLC   |   Terms of use   |   Privacy   |   Contact us   |   What's new   |   Site index