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

Re: st: setting a counter

From   Ulrich Kohler <>
Subject   Re: st: setting a counter
Date   Thu, 15 May 2003 08:53:57 +0200

Rajiv Sinha wrote:
> I have T months of data for N firms  such that there are T rows for each of
> the N firms.  How do I set up a simple counter in Stata to reflect time and
> that varies from 1 to 12 and repeats itself for each of the N records?

. by N (T), sort: gen t = _n


*   For searches and help try:

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