Bookmark and Share

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

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

RE: st: CoxReg. XI may not be combined with by

From   "Kirby Bradley (NATIONAL SERVICES SCOTLAND)" <>
To   "" <>
Subject   RE: st: CoxReg. XI may not be combined with by
Date   Wed, 31 Oct 2012 11:58:27 +0000

Thanks for the reply Maarten, very helpful.

I believe stratification may not be suitable for variables that are of interest. My drug_group_regrouped variable is actually my variable of interest, I want to see if people on different groups of drugs (drug_group_regrouped) are more likely (or not) to experience an outcome. I'm having second thoughts about stratification as the appropriate method for dealing with PH assumption violation for my drug_group_regrouped variable.

I think I need to sit down with a statistician over this one!

Thanks again :-)


-----Original Message-----
From: [] On Behalf Of Maarten Buis
Sent: 31 October 2012 08:48
Subject: Re: st: CoxReg. XI may not be combined with by

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).
> There are two solutions to this as suggested on 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.

Hope this helps,

Maarten L. Buis
Reichpietschufer 50
10785 Berlin

*   For searches and help try:


This message may contain confidential information. If you are not the intended recipient please inform the
sender that you have received the message in error before deleting it.
Please do not disclose, copy or distribute information in this e-mail or take any action in reliance on its contents:
to do so is strictly prohibited and may be unlawful.

Thank you for your co-operation.

NHSmail is the secure email and directory service available for all NHS staff in England and Scotland
NHSmail is approved for exchanging patient data and other sensitive information with NHSmail and GSi recipients
NHSmail provides an email address for your career in the NHS and can be accessed anywhere


*   For searches and help try:

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