Statalist The Stata Listserver


[Date Prev][Date Next][Thread Prev][Thread Next][Date index][Thread index]

st: RE: Generate variable which identify same subject


From   "Maarten Buis" <M.Buis@fsw.vu.nl>
To   <statalist@hsphsun2.harvard.edu>
Subject   st: RE: Generate variable which identify same subject
Date   Mon, 21 Aug 2006 18:09:51 +0200

see: -help encode-
HTH,
Maarten

-----------------------------------------
Maarten L. Buis
Department of Social Research Methodology 
Vrije Universiteit Amsterdam 
Boelelaan 1081 
1081 HV Amsterdam 
The Netherlands

visiting adress:
Buitenveldertselaan 3 (Metropolitan), room Z434 

+31 20 5986715

http://home.fsw.vu.nl/m.buis/
-----------------------------------------

-----Original Message-----
From: owner-statalist@hsphsun2.harvard.edu [mailto:owner-statalist@hsphsun2.harvard.edu]On Behalf Of alvine.bissery@chu-lyon.fr
Sent: maandag 21 augustus 2006 18:06
To: statalist@hsphsun2.harvard.edu
Subject: st: Generate variable which identify same subject


Dear all,

I have a data set with 260 rows for 36 different subject.
All subject are identify by their name, a string variable.
I would like to create a variable "id" with value 1 for the fist subject,
value 2 for the second ... until 36

Name  id
Alli    1
Alli    1
Alli    1
Bear    2
Chea    3
Chea    3
.
.
.

How can I do ?

Thank you

Alvine


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



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