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

st: RE: appling string functions across observations

From   "Nick Cox" <>
To   <>
Subject   st: RE: appling string functions across observations
Date   Fri, 5 Jun 2009 13:00:48 +0100

Check out -fndmtch2- or -fndmtch- from SSC. At first sight they don't
address this problem, but there are at least two ways forward: 

It sounds as if you have surnames and full names (or the equivalent in
your area). -split- the fullnames and work with the separate variables. 

Clone one of the programs above but modify the code to look for string
inclusion rather than strict equality. 



I have a list of two variables: name1 and name2.  I need to check if
name2 occurs in any of the name1s. The regexm command in stata is
perfect for what I want to do, but it checks only one string at a time,
and I need it to somehow rotate over a whole list of names.  

Here is what I  have:  

ram solanki 
goel mehta
ashish gupta


I need to be able to figure out that "solanki" and "mehta" in name2
occur in name1 observation1 and observation2.  

*   For searches and help try:

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