Statalist


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

RE: st: St: How to fit a cox PH model for categorical outcome variable with 3 levels in the same model


From   Maarten buis <[email protected]>
To   [email protected]
Subject   RE: st: St: How to fit a cox PH model for categorical outcome variable with 3 levels in the same model
Date   Fri, 5 Oct 2007 08:16:46 +0100 (BST)

--- Sharon Johnatty <[email protected]> wrote:
> xi: stcox works, but only if variable is coded 1, 2 or 3. It doesn't
> work if the variable is coded 0, 1, 2.

That is very very strange. -xi- just looks at distinct values, not
their actual contents, so it should work with any coding. In the
example below I have changed the coding of drug to 0, 1, 2, and it
works. So, could you tell us a bit more about what is not working, so
we can solve the problem. 

*------------------ begin example ---------------
sysuse cancer, clear
stset studytim, failure(died)

/*Change the coding to 0, 1, 2*/
replace drug = drug -1 

xi: stcox i.drug age
*------------------ end example ------------------
(For more on how to use examples I sent to the Statalist, see
http://home.fsw.vu.nl/m.buis/stata/exampleFAQ.html )

Hope this helps,
Maarten

-----------------------------------------
Maarten L. Buis
Department of Social Research Methodology
Vrije Universiteit Amsterdam
Boelelaan 1081
1081 HV Amsterdam
The Netherlands

visiting address:
Buitenveldertselaan 3 (Metropolitan), room Z434

+31 20 5986715

http://home.fsw.vu.nl/m.buis/
-----------------------------------------


      ___________________________________________________________ 
Want ideas for reducing your carbon footprint? Visit Yahoo! For Good  http://uk.promotions.yahoo.com/forgood/environment.html
*
*   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