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

st: RE: Re: Unique identifier


From   "Nick Cox" <n.j.cox@durham.ac.uk>
To   <statalist@hsphsun2.harvard.edu>
Subject   st: RE: Re: Unique identifier
Date   Fri, 29 Oct 2004 17:47:44 +0100

As various people have pointed out, 

1. -egen, group()- does this (although I'd point 
to the -label- option as possibly useful) 

2. what you did in fact supplied what you wanted. 

In addition, you used -catenate-, which you 
presumably got from SSC. I guess that it's my 
fault that this is not flagged in its write-up 
as a good idea only for Stata 5 users. Users of more 
up-to-date Statas should use -egen, concat()- (in official 
Stata 7 or 8, or in STB-50, Stata 6) for the same 
purpose, concatenation of string variables. 

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

Janet Willard
 
> 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?

*
*   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/



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