Bookmark and Share

Notice: On March 31, it was announced that Statalist is moving from an email list to a forum. The old list will shut down on April 23, and its replacement, is already up and running.

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

st: Sequence of numbers

From   "Tomas Lind" <>
To   <>
Subject   st: Sequence of numbers
Date   Sun, 7 Mar 2010 16:23:12 +0100

Dear Listers,

Is it possible to generate a variable with a sequence of numbers that
repeats itself, for example 1, 2, 3, 1, 2, 3, 1, 2, 3.

I tried -egen fill- but that didn´t work. Another solution would be to make
a new dataset with tree lines with the values 1, 2, 3 and use -expand- and
finally merge that together with the first dataset. However it would be nice
if someone had a simple solution of how to do it within the dataset.


*   For searches and help try:

© Copyright 1996–2015 StataCorp LP   |   Terms of use   |   Privacy   |   Contact us   |   Site index