As a long variable can only contain integer numbers and not strings, I strongly suspect you already have what you want!
The command -encode- helpfully produces value labels to enable you to identify which string converted to which numeric value. If you do not want these labels, type -label drop code1-.
David
[email protected]
-----Original Message-----
From: Janet Willard [mailto:[email protected]]
Sent: 29 October 2004 14:38
To: [email protected]
Subject: st: Re: Unique identifier
I have a dataset that consists of a number of patients and the tooth
treated, typically of the form Evans LL5. I wanted to combine these into a
single numerical variable to identify each specific patient / tooth
combination. The syntax I have used is:
catenate code = patient tooth,punct(no)
encode code,gen(code1)
This returns a long variable which has the "numerical value" EvansLL5. What
I really wanted was a numerical variable such as 1. Can I achive this?
Many thanks,
Janet
_________________________________________________________________
It's fast, it's easy and it's free. Get MSN Messenger today!
http://www.msn.co.uk/messenger
*
* 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/
*
* 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/