Statalist The Stata Listserver


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

[no subject]



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.

Good luck
Svend

__________________________________________

Svend Juul
Institut for Folkesundhed, Afdeling for Epidemiologi
(Institute of Public Health, Department of Epidemiology)
Vennelyst Boulevard 6
DK-8000  Aarhus C, Denmark
Phone: +45 8942 6090
Home:  +45 8693 7796
Email: sj@soci.au.dk
__________________________________________ 

*
*   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–2014 StataCorp LP   |   Terms of use   |   Privacy   |   Contact us   |   What's new   |   Site index