Notice: On April 23, 2014, Statalist moved from an email list to a forum, based at statalist.org.
From | "Kirby Bradley (NATIONAL SERVICES SCOTLAND)" <bradley.kirby@nhs.net> |
To | "statalist@hsphsun2.harvard.edu" <statalist@hsphsun2.harvard.edu> |
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 :-) Brad -----Original Message----- From: owner-statalist@hsphsun2.harvard.edu [mailto:owner-statalist@hsphsun2.harvard.edu] On Behalf Of Maarten Buis Sent: 31 October 2012 08:48 To: statalist@hsphsun2.harvard.edu 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). <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/ ******************************************************************************************************************** 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/