Bookmark and Share

Notice: On March 31, it was announced that Statalist is moving from an email list to a forum. The old list will shut down on April 23, and its replacement, is already up and running.

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

st: Generating Identifier based on string variable

From   Dawood Ashraf <>
To   StataList <>
Subject   st: Generating Identifier based on string variable
Date   Tue, 8 Nov 2011 05:41:55 -0800 (PST)

I am trying to generate a new identifier variable based on names of individuals. The shape of the data is as follows:

Name   Date
Mark    1990

Mark     1991
Mark      1992

Marry    1990

Marry     1991

Marry     1992

Marry  1993

Chris   1993

Bob      1992

Now I want to generate a new variable, Identifier which assign unique number to Mark, Marry, Chris and Bob as 1,2,3,4.

I have looked in the help but could not find anything suitable. I have seen once a question similar to this on STATA and applied myself but somehow skipped from my mind. Any help will be greatly appreciated.



*   For searches and help try:

© Copyright 1996–2015 StataCorp LP   |   Terms of use   |   Privacy   |   Contact us   |   Site index