Bookmark and Share

Notice: On April 23, 2014, Statalist moved from an email list to a forum, based at statalist.org.


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

st: RE: forming groups by an ordered number


From   "Impavido, Gregorio" <[email protected]>
To   "[email protected]" <[email protected]>
Subject   st: RE: forming groups by an ordered number
Date   Fri, 22 Jun 2012 12:19:33 -0400

What about 

gen week = ceil(day/7)



-----Original Message-----
From: [email protected] [mailto:[email protected]] On Behalf Of [email protected]
Sent: Friday, June 22, 2012 12:11 PM
To: [email protected]
Subject: st: forming groups by an ordered number

Dear all,

I have a sequence of numbers that indicate days prior to a given event: (1, 2, 3, 4, 5... up to 90). 


Out of this sequence I would like to have a frequency on a weekly basis. I mean that numbers 1,2...7 take the value of 1 (i.e. this is week 1), numbers 8,9,10, 11...14 take the value of 2. 

Could one help me with that?


Best,
Rado


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


© Copyright 1996–2018 StataCorp LLC   |   Terms of use   |   Privacy   |   Contact us   |   Site index