[R] Using contrast with cox models

Patterson, Stuart spatterson at RVC.AC.UK
Mon Nov 21 15:47:48 CET 2016


Hi,

I was wondering if I could get some advice on the following question please:

I have a time-dependent cox model with three variables, each of which interacts with the other two. So my final model is:

fit12<-coxph(formula = Surv(data$TimeIn, data$Timeout, data$Status) ~ data$Year+data$Life_Stg+data$prev.tb +data$prev.tbdata$Life_Stg + data$Yeardata$Life_Stg + data$Year*data$prev.tb + frailty(data$Natal_Group), data = data)

For my variables, there are 3 categories of year, three of year, and prev.tb is a binary variable. Because of the interactions, when I present the results, I want to present the Hazard ratio, 95% CI, and p value for each combination of the three variables. How do I get R to give me these values please?

I think that the contrast function does this for other models but does not work for coxph?



Many thanks

Stuart Patterson

Royal Veterinary College, University of London


[RVC Logo - link to RVC Website]<http://www.rvc.ac.uk>    [Twitter icon - link to RVC (Official) Twitter] <http://twitter.com/RoyalVetCollege>     [Facebook icon - link to RVC (Official) Facebook] <http://www.facebook.com/theRVC>     [YouTube icon - link to RVC YouTube] <http://www.youtube.com/user/RoyalVetsLondon?feature=mhee>     [Pinterest icon - link to RVC Pinterest] <http://pinterest.com/royalvetcollege/>     [Instagram icon - link to RVC Instagram] <http://instagram.com/royalvetcollege>

This message, together with any attachments, is intended for the stated addressee(s) only and may contain privileged or confidential information. Any views or opinions presented are solely those of the author and do not necessarily represent those of the Royal Veterinary College (RVC). If you are not the intended recipient, please notify the sender and be advised that you have received this message in error and that any use, dissemination, forwarding, printing, or copying is strictly prohibited. Unless stated expressly in this email, this email does not create, form part of, or vary any contractual or unilateral obligation. Email communication cannot be guaranteed to be secure or error free as information could be intercepted, corrupted, amended, lost, destroyed, incomplete or contain viruses. Therefore, we do not accept liability for any such matters or their consequences. Communication with us by email will be taken as acceptance of the risks inherent in doing so.

	[[alternative HTML version deleted]]



More information about the R-help mailing list