Bookmark and Share

Notice: On April 23, 2014, Statalist moved from an email list to a forum, based at statalist.org.


[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: st: Re: Cox regression - model comparison


From   Maarten buis <maartenbuis@yahoo.co.uk>
To   statalist@hsphsun2.harvard.edu
Subject   Re: st: Re: Cox regression - model comparison
Date   Thu, 3 Feb 2011 14:48:56 +0000 (GMT)

--- On Thu, 3/2/11, Janet Hill wrote:
> I am attempting to use Cox's regression for the situation
> where there are 2 main factors and a possible interaction.
> I wanted to see if the interaction term was significant but
> I cannot use lrtest with the robust option.

In those cases you use -test-, to test the hypothesis that the
interaction terms are all simultaneously zero. The tricky part
is that you need to know how the Stata calls the intereffects,
which is where the -coeflegend- option can be useful.

Below is an example with one factor and one continous variable
because that is what is in the example dataset, but the logic
is the same.

*------------ begin example --------------
sysuse cancer
stset studytime, failure(died)
stcox i.drug##c.age

// to use -test- we need to know how 
// Stata calls the interaction terms
// you can get a list of these names 
// by replaying the last regression 
// witht he -coeflegend- option
stcox , coefl

// test whether the interaction effects
// are zero.
test 2.drug#c.age = 3.drug#c.age = 0
*--------------- end example ---------------
(For more on examples I sent to the Statalist see: 
http://www.maartenbuis.nl/example_faq )

Hope this helps,
Maarten

--------------------------
Maarten L. Buis
Institut fuer Soziologie
Universitaet Tuebingen
Wilhelmstrasse 36
72074 Tuebingen
Germany

http://www.maartenbuis.nl
--------------------------



      

*
*   For searches and help try:
*   http://www.stata.com/help.cgi?search
*   http://www.stata.com/support/statalist/faq
*   http://www.ats.ucla.edu/stat/stata/


© Copyright 1996–2018 StataCorp LLC   |   Terms of use   |   Privacy   |   Contact us   |   Site index