Hello everyone,
my data is in the context of NBA basketball. The focus is on players in the starting lineup (denoted as starter1, starter2 etc.), see the following example:
For each player, I would need a unique identifier. If my data consisted only of one "starter" variable (one player), the solution would be quite easy:
However, the player names are distributed across the 5 starting lineup variables. Thus, "Duckworth, Kevin" sometimes may appear in starter1 and sometimes in one of the four other variables. My aim is to have five variables (e.g., starter1_num, starter2_num etc.) similar to the string variable, but consisting of a unique numeric identifier (instead of the string). Probably it is easy, however I somehow cannot see a solution.
Thanks for your help already in advance.
Best regards,
Pascal
my data is in the context of NBA basketball. The focus is on players in the starting lineup (denoted as starter1, starter2 etc.), see the following example:
Code:
* Example generated by -dataex-. For more info, type help dataex clear input str7 season str33 team str27 date str24(starter1 starter2 starter3 starter4 starter5) "1990-91" "Portland Trail Blazers" "February 28, 1991" "Duckworth,Kevin" "Drexler,Clyde" "Williams,Buck" "Porter,Terry" "Kersey,Jerome" "1990-91" "Sacramento Kings" "February 25, 1991" "Carr,Antoine" "Mays,Travis" "Simmons,Lionel" "Les,Jim" "Causwell,Duane" "1990-91" "Minnesota Timberwolves" "January 5, 1991" "Richardson,Pooh" "Campbell,Tony" "Corbin,Tyrone" "Mitchell,Sam" "Spencer,Felt"
Code:
egen identifier=group(starter1)
Thanks for your help already in advance.
Best regards,
Pascal

Comment