Statalist


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

st: AW: ST: create different /distinct identifier for observations


From   "Martin Weiss" <martin.weiss1@gmx.de>
To   <statalist@hsphsun2.harvard.edu>
Subject   st: AW: ST: create different /distinct identifier for observations
Date   Sat, 12 Sep 2009 14:46:21 +0200

<>


******
gen obsID=_n
******


HTH
Martin


-----Ursprüngliche Nachricht-----
Von: owner-statalist@hsphsun2.harvard.edu
[mailto:owner-statalist@hsphsun2.harvard.edu] Im Auftrag von Laura Platchkov
Gesendet: Samstag, 12. September 2009 14:24
An: statalist@hsphsun2.harvard.edu
Betreff: st: ST: create different /distinct identifier for observations

Dear all, 

I just have a basic question. I have 20'000 observations, but a lot of
different observation correspond to the same object (a lake) and hence, has
the same ID. To do some commmand, I need that each observaiton have a unique
identifier. So I need to give 20'000 different identifiers, one for each
observation. 

So I neeed to create a new variable called obsID, which goes from 1 to
20'000, one for each observation. I can't copy paste my data and do it on
Excel, because it would be to long. Can STATA Edit do that? 

Thanks,

Laura 

*
*   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/


*
*   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/



© Copyright 1996–2014 StataCorp LP   |   Terms of use   |   Privacy   |   Contact us   |   What's new   |   Site index