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]

Re: st: Unique identifier from a string name

From   Nick Cox <>
Subject   Re: st: Unique identifier from a string name
Date   Thu, 24 Nov 2011 15:50:13 +0000

I don't understand in what way your problem needs anything esoteric.

-egen, group()- can be used with numeric variables too, but it is
based on Stata's default sort orders. -encode- by default works


On Thu, Nov 24, 2011 at 3:10 PM, Barry Quinn <> wrote:
> Thanks for all the suggestions.
> The context of the problem is to build a panel from yearly data using firm names as the unique id with the -merge- command.
> Nick/Daniel:
> I had thought of  -encode- and -egen-'s-group()- but my panel is unbalanced and I presume both of these are based on an alphabetical sort order?
> Brendan: I think your solutions may prove more useful although am not sure how to turn it into an id to use with -merge-

*   For searches and help try:

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