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:

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


Links to this post:

Create a Link

<< Home

This page is powered by Blogger. Isn't yours?