Wednesday, March 08, 2006
st: RE: group option for generate
This function went undocumented in Stata 9.
You can blame Svend Juul. Svend gave a very witty talk at a Berlin users' meeting pointing out functions and -egen- functions with the same name, but different definitions; the same definition, but different names; and much else besides.
His talk is here: http://www.stata.com/meeting/2german/Juul.pdf
So, StataCorp looked in the stables, and saw that he was right. It was a mess. So, they went to work renaming, and tidying a few ancient oddities out of sight.
Actually, you can blame me, as I recall suggesting that this one be hidden, my argument being that -egen, group()-, although it came later, was far more useful and far more widely used. I still think that's true.
-group()-, which is a function, not an option, is documented at version 8 [R] p.454.
group(n) divides the data into n nearly equal groups, with integer values 1 to ceil(n). That depends on the current sort order.
-group(varname)- appears equivalent to
sort varname ... = group(max of varname) <sort back again>
roy wada > Can someone tell me what kind of distribution is created by > -group( )- > option for -gen- command? I am using 9.1 for Windows. > > sysuse auto, clear > gen repNew=group(rep78)
* * 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/
Links to this post: