Hello R helpers:
*My first message didn't pass trough filter so here it's again*
I would like to obtain probability of an event for one single patient as a
function of time (from survfit.coxph) object, as I want to find what is the
probability of an event say at 1 month and what is the probability of an
event at 80 months and compare. So I tried the following but it fails
miserably. I looked at some old posts but could not figure out the solution.
Here's what I did where for one single patient, the answer is
"NULL". Could
anyone help me with the problem?
R.app GUI 1.34 (5589 Leopard build 32-bit)
> library(glmpath)
*> dataall <- list(x=lung.data$x[1:130,], time=lung.data$time[1:130],
status=lung.data$status[1:130])*
*
> fit.a <- coxpath(dataall)
> testall <- list(x=lung.data$x[131:137,], time=lung.data$time[131:137],
status=lung.data$status[131:137])
> testpred <- predict(fit.a, testall, s=0.99, type='coxph',
mode='lambda.fraction')
> testpred
Call:
coxph(formula = Surv(time, status) ~ x, method = object$method)
coef exp(coef) se(coef) z p
karno -0.00756 0.992 0.0364 -0.208 0.84
Likelihood ratio test=0.89 on 1 df, p=0.344 n= 7
> newd1 <- list(testall$x[1,])
> survtest <- survfit(testpred,newdata=newd1,individual=T)
> survtest
Call: survfit(formula = testpred, newdata = newd1, individual = T)
records n.max n.start events median 0.95LCL 0.95UCL
7 0 0 0 0 0 0
> summary(survtest)
Call: survfit(formula = testpred, newdata = newd1, individual = T)
time n.risk n.event survival std.err lower 95% CI upper 95% CI
> survtest$survival
NULL
***
[[alternative HTML version deleted]]