Stata The Stata listserver
[Date Prev][Date Next][Thread Prev][Thread Next][Date index][Thread index]

st: RE: RE: RANDOM ID GENERATORS & BACKWARD SELECTION


From   "Nick Cox" <[email protected]>
To   <[email protected]>
Subject   st: RE: RE: RANDOM ID GENERATORS & BACKWARD SELECTION
Date   Wed, 29 Oct 2003 15:57:35 -0000

Or, for the simplest problems, 

gen caseid = _n 

Nick 
[email protected] 

P.S. note also that 

. search identifier 

points you to an FAQ on this: 

http://www.stata.com/support/faqs/data/group.html

Alexander Tsai
 
> The subject of your e-mail suggested you wanted a random 
> ID, but your
> e-mail asked for a consecutive ID --
> 
> egen caseid=seq()
> 
> will do the consecutive ID for you.

Clive Nicholas
 
> (1) How do you tell Stata to generate a case ID variable that
> consecutively numbers all the cases in your dataset, 
> starting with 1, 2,
> 3, ... N?
> 

*
*   For searches and help try:
*   http://www.stata.com/support/faqs/res/findit.html
*   http://www.stata.com/support/statalist/faq
*   http://www.ats.ucla.edu/stat/stata/



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