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

Re: st: how to generate a variable as follow


From   "Dimitriy V. Masterov" <[email protected]>
To   "[email protected]" <[email protected]>
Subject   Re: st: how to generate a variable as follow
Date   Tue, 6 Jan 2004 11:39:03 -0600 (CST)

How about:

gen x=mod(_n,6)
replace x=6 if x==0

I think that should work.


DVM

On Wed, 7 Jan 2004, rghuang wrote:

> 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/
>

_______________________________________________________________________________
Dimitriy V. Masterov

Work:
Center for Social Program Evaluation
1155 East 60th St. Room 038
Chicago, IL 60637
Work: (773)256-6005
Fax: (773)256-6313

Home:
1312 East 53rd St., Apt.309
Chicago, IL 60615
Mobile: (773)220-2760


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