Statalist The Stata Listserver


[Date Prev][Date Next][Thread Prev][Thread Next][Date index][Thread index]

RE: st: Segmenting a dataset


From   "Nick Cox" <n.j.cox@durham.ac.uk>
To   <statalist@hsphsun2.harvard.edu>
Subject   RE: st: Segmenting a dataset
Date   Thu, 17 May 2007 22:27:30 +0100

Look up at the stars! This is easier with -ceil()-: 

gen int group = ceil(_n / 30) 

Nick 
n.j.cox@durham.ac.uk 

David Kantor
 
> In my response to "Segmenting a dataset", I wrote,
> 
> gen int group = floor(_n / 30)
> 
> That is just a bit off.  It really ought to be
> 
> gen int group = floor((_n-1) / 30)

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