At 18:06 04/02/04 +0100, Randy Brenkers wrote:
Hello,
I have a string variable "id".
id
a1
a2
a3
a4
a12
a13
b1
b2
b20
...
How can I create a string variable that contains only the first letter of
each observation?
Use the -substr()- function. See -help functions- or -help strfun-.
Roger
--
Roger Newson
Lecturer in Medical Statistics
Department of Public Health Sciences
King's College London
5th Floor, Capital House
42 Weston Street
London SE1 3QD
United Kingdom
Tel: 020 7848 6648 International +44 20 7848 6648
Fax: 020 7848 6620 International +44 20 7848 6620
or 020 7848 6605 International +44 20 7848 6605
Email: [email protected]
Website: http://www.kcl-phs.org.uk/rogernewson
Opinions expressed are those of the author, not the institution.
*
* 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/