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

From |
Maarten buis <maartenbuis@yahoo.co.uk> |

To |
statalist@hsphsun2.harvard.edu |

Subject |
Re: st: St: How do fit a cox PH model for categorical outcome variable with 3 levels in the same model |

Date |
Wed, 3 Oct 2007 08:24:34 +0100 (BST) |

--- Sharon Johnatty <Sharon.Johnatty@qimr.edu.au> wrote: > I've stset my data and I'm able to run cox models, no problem. The > question is how do I obtain HRs for an outcome variable with three > levels, e.g. var_1_2 coded 0, 1, 2 in the same model, and obtain > separate estimates for 0 vs. 1 and 0 vs. 2. Right now I'm able to do > this using stcoxkm, by(var_1_2), then type stcox. But Stata does > not allow me to run an adjusted model in this way. Is there another > way to fit a single model for a categorical variable with more than 2 > levels for both univariate and multivariate cox regression? -stcox- is the Stata command for estimating a cox model, and it allows multiple independent variables, and the output immediately gives you hazard ratios. See the example below. The -xi:- prefix used in this example is a convenience program that makes dummy variables from the variable drug. So both _Idrug_2 and _Idrug_3 compare with _Idrug_1 (the category left out, or the reference category). *---------- begin example --------- sysuse cancer stset studytim, failure(died) 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/ ----------------------------------------- ___________________________________________________________ Yahoo! Answers - Got a question? Someone out there knows the answer. Try it now. http://uk.answers.yahoo.com/ * * 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/

**Follow-Ups**:**RE: st: St: How to fit a cox PH model for categorical outcome variable with 3 levels in the same model***From:*"Sharon Johnatty" <Sharon.Johnatty@qimr.edu.au>

**References**:**st: St: How do fit a cox PH model for categorical outcome variable with 3 levels in the same model***From:*"Sharon Johnatty" <Sharon.Johnatty@qimr.edu.au>

- Prev by Date:
**Re: st: tobit probit censored data confusion** - Next by Date:
**st: panel estimation with varying coefficient over individuals** - Previous by thread:
**st: St: How do fit a cox PH model for categorical outcome variable with 3 levels in the same model** - Next by thread:
**RE: st: St: How to fit a cox PH model for categorical outcome variable with 3 levels in the same model** - Index(es):

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