I'm new to survival analysis, and really need your help. Thank you so much!
I want to analyze:
- how soon will a patient die in days?
- whats the probability for the patient to die?
Are these two the possible outcomes of survival analysis in R?
I tried the following code, and couldn't understand the summary results:
library(survival)
addicts <- read.table("ADDICTS.txt", T)
names(addicts) <- c('id', 'clinic', 'status', 'survt','prison','dose')
Surv(addicts$survt, addicts$status ==1)
y <- Surv(addicts$survt, addicts$status ==1)
kmfit1 <- survfit(y~1)
summary(kmfit1)
plot(kmfit1)
coxmodel <- coxph(y~prison + dose + clinic, data = addicts)
summary(coxmodel)
results:
Which line are the two things I want? or when a new patients comes in, how to get that?
Thank you so much!