Notice: On April 23, 2014, Statalist moved from an email list to a forum, based at statalist.org.
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
st: filling in existing ids and generating new ids for unique actors
From
Erik Aadland <[email protected]>
To
<[email protected]>
Subject
st: filling in existing ids and generating new ids for unique actors
Date
Fri, 7 Sep 2012 12:03:54 +0000
Dear Statalist.
I have an unbalanced panel dataset.
The structure is as follows:
year actor_id actor
2000 . Paul
2001 . Paul
2002 . Paul
2000 . Sarah
2001 1 Sarah
2002 1 Sarah
2000 . Simon
2001 2 Simon
2002 2 Simon
I have 2 problems:
1. I want to fill in the missing existing actor_id for those actors that already have an actor_id in some years but not others.
2. I want to generate a new unique actor_id for those actors that have no actor_id in the dataset. This actor_id needs to be different from those already existing for other actors in the dataset.
The variable -actor- lists the unique name for each actor and this unique name could be used as a basis for assigning the actor_id.
Any input on these problems would be greatly appreaciated.
Kind regards,
Erik.
*
* For searches and help try:
* http://www.stata.com/help.cgi?search
* http://www.stata.com/support/statalist/faq
* http://www.ats.ucla.edu/stat/stata/