Re: [R] coxph with smooth survival

2013-01-21 Thread Terry Therneau
For your first question -- read the manual. ?survfit.coxph will reveal the "censor" argument, which controls the inclusion of points where the curve does not drop. For your second, "smooth" is in the eye of the beholder, literally. If the reason for a smooth curve is to plot it, you need to d

Re: [R] coxph with smooth survival

2013-01-18 Thread Andrews, Chris
f.int=FALSE) lines(steps.x, steps.y, col=2) smoothfun <- approxfun(steps.x, steps.y) plot(smoothfun, from=0, to=3, add=TRUE, col=3, n=1000, lty=2) -Original Message- From: Bond, Stephen [mailto:stephen.b...@cibc.com] Sent: Thursday, January 17, 2013 9:49 AM To: r-help@r-project.org S

Re: [R] coxph with smooth survival

2013-01-17 Thread Bond, Stephen
I also tried fitting a spline to the resulting survival curve and the result was horrible. maybe spline won't work or knots need special handling. overall, I must have the final point of the smooth survival to be same as the final point of the raw Cox survival and no flat days, the drops sho

[R] coxph with smooth survival

2013-01-17 Thread Bond, Stephen
Hello users, I would like to obtain a survival curve from a Cox model that is smooth and does not have zero differences due to no events for those particular days. I have: > sum((diff(surv))==0) [1] 18 So you can see 18 days where the survival curve did not drop due to no events. Is there a wa