you could try this (assuming var a = last name, b = first name, ...):
sort a b c
gen tel=_n
by a b c: egen pid=min(tel)
drop tel
didier
-----Original Message-----
From: "Paolo Grillo, MD" <[email protected]>
To: [email protected]
Date: Fri, 04 Feb 2005 10:13:10 +0100
Subject: st: create unique variables
I have a dataset with the following variables:
last name
first name
date of birth
Since this dataset contains more than one record for individual, I would
create a unique variable for subject (ID).
Could anyone help me in this problem?
Thank in advance
--
* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
Paolo Grillo MD
Nephrologist
Statisticians
EPOCA Research Center for Occupational, Clinical & Environmental Epidemiology
Department of Occupational and Environmental Health "Clinica L. Devoto"
University of Milan
Via San Barnaba 8
20122 Milano - ITALY
Tel: +39 02 503-20148
Fax: +39 02 503-20126
E-Mail [email protected]
*
* 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/