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

st: RE: RE: Extracting names from string


From   "Nick Cox" <[email protected]>
To   <[email protected]>
Subject   st: RE: RE: Extracting names from string
Date   Tue, 17 Feb 2004 09:52:12 -0000

Correcting a typo 

Nick 
[email protected] 

> gen str1 doctor = "" 
> split staff, parse(,) 
> replace doctor = staff1 if index(staff1, "DR ") 
> replace doctor = staff2 if index(staff2, "DR ") 
> replace doctor = staff1 if index(staff1, "DT ") 
> replace doctor = staff2 if index(staff2, "DT ") 
> replace doctor = staff1 if index(staff2, "NURSE") 
> replace doctor = staff2 if index(staff1, "NURSE") 
> replace doctor = staff1 if trim(staff2) == "" 

<<winmail.dat>>




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