Statalist The Stata Listserver


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

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


From   Joseph Coveney <[email protected]>
To   Statalist <[email protected]>
Subject   RE: st: Unexpected -egen , fill()- behavior
Date   Mon, 04 Dec 2006 11:31:42 +0900

Thanks to Jeph Herrin, Nick Cox and Kit Baum for replying.

I was aware of the -egen , fill()- pattern syntax, but got into the habit of
spelling the full sequence out over the past couple of years, after having
trouble getting the twice-through-the-pattern to work properly a while back.
In the current case, I ended up using -generate byte group = sum(mod(_n, 4)
== 1)-, but Jeph's -ceil()- looks faster and is certainly more elegant.

In any event, as Kit mentions, the command's usage could be better
documented in the online help file.  Perhaps a couple of examples of
achieving the task might be given at the bottom of the help file, one
with -egen , fill()- and the other with -egen , seq() block()- that Nick
mentioned as an alterative.

Joseph Coveney

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