[R] Plotting the effect of a predictor using RMS

Thomas Speidel thomas.r at tmbx.com
Mon Feb 24 18:06:25 CET 2014


I'm using the RMS package to fit and interpret a Cox-PH model:

############
require(rms)
f <- cph(S ~ rcs(x1, 3) + x2 + x3, method="efron", x=TRUE, y=TRUE, 
surv=TRUE, time.inc=12)
f1 <- summary(f, x1=c(110, 130))
plot(f1, log=TRUE, main='')
############

I would like to display the HR for x1 for two different changes in the 
predictor, say from 25th to the 50th, and 50th to 75th percentiles of 
x1.  Is it possible to do this in the same plot and _only_ for x1?

Thanks,
Thomas Speidel



More information about the R-help mailing list