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" <n.j.cox@durham.ac.uk>
To   <statalist@hsphsun2.harvard.edu>
Subject   st: RE: RE: Extracting names from string
Date   Tue, 17 Feb 2004 09:52:12 -0000

Correcting a typo 

Nick 
n.j.cox@durham.ac.uk 

> 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–2014 StataCorp LP   |   Terms of use   |   Privacy   |   Contact us   |   What's new   |   Site index