Ok I don't know what I've done differently, but coding with 0, 1, 2
works!! For some reason it did not before but....gremlins are in my
computer (or my head.....)
Thanks so much for your help
Sharon
-----Original Message-----
From: [email protected]
[mailto:[email protected]] On Behalf Of Maarten buis
Sent: Friday, 5 October 2007 5:17 PM
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
--- 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/
*
* 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/