I successfully plotted Kaplan-Meier estimates of survival over time, but
I am struggling to overlay fitted estimates of tissue concentrations of
a contaminant (ct) over time. Here is the code I wrote,
setiss <- pretty(range(se3t6$ct))
se3.surv <- survfit(Surv(time, cens) ~ treat,
data = se3[se3$treat=="8",], conf.type="plain")
plot(se3.surv, conf.int=T, cex=1.5, xlab="Days", ylab="Survival")
text(30,0.02,cex=2.0,"ES3-Treatment 6")
axis(side = 4, at = setiss/15, lab = setiss, srt = 90)
mtext("[Se]tissue (ug/g dw)", side = 4, line = 3)
lines(se3t6$time, se3t6$ct, type = "p") # add observed concns.
lines(se3t6fit$time, se3t6fit$ct, type = "l") # add fitted curve
All but the the last two commands (lines) work. Concentrations range
from 1.9 to 12.7. I suspect that values may be plotted out of the range
for survival (0 - 1). It would explain why I cannot see the plotted
points and fitted curve.
I appreciate suggestions to solve this problem.
Thanks
Manolo
|