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, **statalist.org** is already up and running.

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

From |
"Tomas Lind" <tomas.lind@ki.se> |

To |
<statalist@hsphsun2.harvard.edu> |

Subject |
st: SV: RE: Sequence of numbers |

Date |
Sun, 7 Mar 2010 16:31:02 +0100 |

Thank Martin for your kind answer. :) Tomas -----Ursprungligt meddelande----- Från: owner-statalist@hsphsun2.harvard.edu [mailto:owner-statalist@hsphsun2.harvard.edu] För Martin Weiss Skickat: den 7 mars 2010 16:26 Till: statalist@hsphsun2.harvard.edu Ämne: st: RE: Sequence of numbers <> ******* clear* set obs 99 egen byte myseq = seq(), from(1) to(3) block(1) l ******* HTH Martin -----Original Message----- From: owner-statalist@hsphsun2.harvard.edu [mailto:owner-statalist@hsphsun2.harvard.edu] On Behalf Of Tomas Lind Sent: Sonntag, 7. März 2010 16:23 To: statalist@hsphsun2.harvard.edu Subject: st: Sequence of numbers 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. /Tomas * * 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/ * * 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/ * * 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/

**References**:**st: Sequence of numbers***From:*"Tomas Lind" <tomas.lind@ki.se>

- Prev by Date:
**st: RE: SV: RE: RE: Sequence of numbers** - Next by Date:
**st: SV: RE: RE: Sequence of numbers** - Previous by thread:
**st: RE: RE: Sequence of numbers** - Next by thread:
**st: SV: RE: RE: Sequence of numbers** - Index(es):