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)


    egen newvar = cut(varname) , group(5)

The latter seems to be closest to what you want.

Good luck


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

*   For searches and help try:

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