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: CoxReg. XI may not be combined with by
From
Maarten Buis <[email protected]>
To
[email protected]
Subject
Re: st: CoxReg. XI may not be combined with by
Date
Wed, 31 Oct 2012 09:48:04 +0100
On Tue, Oct 30, 2012 at 5:10 PM, Kirby Bradley wrote:
> Running a coxreg model <snip> My covariate 'drug_group_regrouped' failed the schoenfeld test of proportionality (p<0.05).
<snip>
> There are two solutions to this as suggested on http://www.ats.ucla.edu/stat/stata/seminars/stata_survival/default.htm. The one that I can kind of understand is to stratify on the non-proportional predictor, but I can't get the syntax to work. I'm trying:
>
> bysort drug_group_regrouped: xi: stcox i.gender i.agecategory_regrouped if gi_history==0, scaledsch(sca*) schoenfeld (sch*)
Stratifying in the context of a Cox regression typically means that
the baseline hazard is allowed to be different across groups but the
hazard ratios of all other variables are kept constant. If that is
what you want to do than the -bysort:- prefix would be incorrect, as
that would also give you different hazard ratios across groups.
Instead you would than want to use the -strata()- option in -stcox-,
see -help stcox-. Moreover, you will just want to leave the -xi:-
prefix away and use factor variables instead. So the syntax you
probably want is:
stcox i.gender i.agecategory_regrouped if gi_history==0,
scaledsch(sca*) schoenfeld (sch*) strata(drug_group_regrouped)
A nice and pretty complete introduction to survival analysis and how
to do that in Stata is:
Mario Cleves, William Gould, Roberto G. Gutierrez, and Yulia V.
Marchenko (2010) "An Introduction to Survival Analysis Using Stata",
Third Edition. College Station, TX: Stata Press.
<http://www.stata.com/bookstore/survival-analysis-stata-introduction/>
Hope this helps,
Maarten
---------------------------------
Maarten L. Buis
WZB
Reichpietschufer 50
10785 Berlin
Germany
http://www.maartenbuis.nl
---------------------------------
*
* For searches and help try:
* http://www.stata.com/help.cgi?search
* http://www.stata.com/support/faqs/resources/statalist-faq/
* http://www.ats.ucla.edu/stat/stata/