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

Re: st: Generate variable


From   Richard Williams <Richard.A.Williams.5@ND.edu>
To   statalist@hsphsun2.harvard.edu
Subject   Re: st: Generate variable
Date   Sun, 08 May 2005 21:03:29 -0500

At 09:46 PM 5/8/2005 -0400, you wrote:
Hi,

A few quick questions:

(1) How do I generate a new variable in a dataset that is equal to the observations number? eg. suppose have data like:
gen id = _n


(3) also, can you refere me to a good site where i can get more information on writing loops?
Here is one good FAQ:

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

*
*   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–2014 StataCorp LP   |   Terms of use   |   Privacy   |   Contact us   |   What's new   |   Site index