Statalist


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

Re: st: How to create an automatic numbering within stata


From   Maarten buis <maartenbuis@yahoo.co.uk>
To   statalist@hsphsun2.harvard.edu
Subject   Re: st: How to create an automatic numbering within stata
Date   Thu, 8 Oct 2009 19:02:09 +0000 (GMT)

--- On Thu, 8/10/09, amatoallah ouchen wrote:
> I was wondering if you could help me figure something out
> related to the creating of  an automatic  numbering within
> stata. in fact, my data set are sorted by ticker and by
> date, I need to create a column that contains the numbering
> of the observations (1,2....,N) within each ticker.

bys ticker (data) : gen int id = _n

hope this helps,
Maarten

--------------------------
Maarten L. Buis
Institut fuer Soziologie
Universitaet Tuebingen
Wilhelmstrasse 36
72074 Tuebingen
Germany

http://www.maartenbuis.nl
--------------------------


      

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