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


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

st: How to create a new variable ...


From   Alberto R Osella <arosella@irccsdebellis.it>
To   "statalist@hsphsun2.harvard.edu" <statalist@hsphsun2.harvard.edu>
Subject   st: How to create a new variable ...
Date   Thu, 05 May 2011 20:05:44 +0200

Oliver and Daniel thank you again.
Sorry but it happened that I was quite unclear with my previous post.
My oldvar takes on values from 1 to 306.
Indeed I need to generate a new variable in this way:
newvar which takes on the value 1 each time oldvar takes on the values 1, or 6, or 11,.....,or 301 newvar which takes on the value 2 each time oldvar takes on the values 2, or 7, or 12,.....,or 302 newvar which takes on the value 3 each time oldvar takes on the values 3, or 8, or 13....., or 303 newvar which takes on the value 4 each time oldvar takes on the values 4, or 9, or 14,.....,or 304 newvar which takes on the value 5 each time oldvar takes on the values 5, or 10, or 15,.....,or 305
Thank you

Alberto R. Osella, MD, PhD
Laboratorio di Epidemiologia e Biostatistica
IRCCS Saverio de Bellis
Via Turi, 27
70013 Castellana Grotte (BA)
Italia
Tel:    +39 0804994655
Fax:    +39 0804994650
e-mail: arosella@irccsdebellis.it

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


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