Statalist The Stata Listserver


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

Re: st: Generate variable which identify same subject


From   Jeph Herrin <[email protected]>
To   [email protected]
Subject   Re: st: Generate variable which identify same subject
Date   Tue, 22 Aug 2006 12:00:17 -0400

 egen id=group(Name)

will do it.

[email protected] wrote:
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–2024 StataCorp LLC   |   Terms of use   |   Privacy   |   Contact us   |   What's new   |   Site index