Here's one way:
gen x=1+mod(_n-1,6)
Al Feiveson
-----Original Message-----
From: rghuang [mailto:0034058@fudan.edu.cn]
Sent: Tuesday, January 06, 2004 11:32 AM
To: statalist@hsphsun2.harvard.edu
Subject: st: how to generate a variable as follow
x
1
2
3
4
5
6
1
2
3
4
5
6
1
2
3
4
5
6
how can i get it.thank you!
*
* 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/
*
* 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/