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]
st: CoxReg. XI may not be combined with by
From
"Kirby Bradley (NATIONAL SERVICES SCOTLAND)" <[email protected]>
To
"[email protected]" <[email protected]>
Subject
st: CoxReg. XI may not be combined with by
Date
Tue, 30 Oct 2012 16:10:47 +0000
Hi,
Running a coxreg model using the following syntax:
*Set reference values for categorical variables
char gender [omit]1
char drug_group_regrouped [omit]99
char agecategory_regrouped [omit]0
preserve
xi: stcox i.gender i.agecategory_regrouped i.drug_group_regrouped if gi_history==0, scaledsch(sca*) schoenfeld (sch*)
stphtest, rank detail
restore
preserve
xi: stcox i.gender i.agecategory_regrouped i.drug_group_regrouped if gi_history==1, scaledsch(sca*) schoenfeld (sch*)
stphtest, rank detail
restore
My covariate 'drug_group_regrouped' failed the schoenfeld test of proportionality (p<0.05).
Test of proportional-hazards assumption
Time: Rank(t)
----------------------------------------------------------------
| rho chi2 df Prob>chi2
------------+---------------------------------------------------
_Igender_2 | -0.03326 0.59 1 0.4408
_Iagecateg~1| -0.03900 0.82 1 0.3639
_Iagecateg~2| -0.02042 0.22 1 0.6362
_Iagecateg~3| -0.04371 1.07 1 0.3012
_Idrug_gro~0| -0.09669 4.93 1 0.0264
_Idrug_gr~98| -0.06225 2.08 1 0.1493
------------+---------------------------------------------------
global test | 7.40 6 0.2857
----------------------------------------------------------------
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*)
But I'm being informed that xi may not be used with by. I'm already splitting on gi_history, but I'm not sure if that's the same thing as stratifying.
I'm an SPSS user normally, not very familiar with stata (or cox reg for that matter). In SPSS I would include the non proportional predictor in the strata section of the model, which I think is what the bysort function is doing, but not doing in my case.
Any suggestions on way forward? Would putting another if statement in the model work, like so:
xi: stcox i.gender i.agecategory_regrouped if gi_history==0 and if age_category_regrouped == 0, scaledsch(sca*) schoenfeld (sch*)
As I said earlier I'm not sure if that's the same as stratifying.
Thanks in advance
Brad
********************************************************************************************************************
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:
* http://www.stata.com/help.cgi?search
* http://www.stata.com/support/faqs/resources/statalist-faq/
* http://www.ats.ucla.edu/stat/stata/