Statalist The Stata Listserver


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

RE: st: Unexpected -egen , fill()- behavior


From   "Nick Cox" <[email protected]>
To   <[email protected]>
Subject   RE: st: Unexpected -egen , fill()- behavior
Date   Sun, 3 Dec 2006 15:41:31 -0000

Another solution is -egen group = seq(), block(4)-. 

Nick 
[email protected] 

Jeph Herrin
 
> Or perhaps even better,
> 
> . sort x
> . gen group = ceil(_n/4)

Jeph Herrin 

> > . egen group=fill(1 1 1 1 2 2 2 2 )
> > 
> > will do what you need.

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