Svend is wrong on one detail. The function -group()- still
exists in Stata 9; it is just undocumented. My post
earlier in this thread (which Svend probably read
after posting this) explains more.
Nick
[email protected]
Svend Juul
>
> From Enzo Coviello <[email protected]>
> Enzo wrote (I assume that "=3D" means "="):
>
> I am using this commands to group observations for risk score
>
> stcox age treat
> predict xb,xb
> drop if xb==.
>
> gen gr_risk = group(5)
>
> This last command works but I do not find where
> the function group() is documented (and why I still use it)
> ---------------------------------------------------------------
>
> In what sense do you mean that "the command works"? No such function
> exists in official Stata (at least not version 9). But -egen- has:
>
> egen newvar = group(varlist)
>
> and
>
> egen newvar = cut(varname) , group(5)
>
> The latter seems to be closest to what you want.
*
* 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/