Statalist The Stata Listserver


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

RE: st: gen newvar=3Dgroup()


From   "Nick Cox" <[email protected]>
To   <[email protected]>
Subject   RE: st: gen newvar=3Dgroup()
Date   Mon, 12 Mar 2007 10:43:35 -0000

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/



© Copyright 1996–2024 StataCorp LLC   |   Terms of use   |   Privacy   |   Contact us   |   What's new   |   Site index