[Date Prev][Date Next][Thread Prev][Thread Next][Date index][Thread index]
Re: st: Generate variable which identify same subject
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/