0

I'm new to survival analysis, and really need your help. Thank you so much!

I want to analyze:

  1. how soon will a patient die in days?
  2. 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:

enter image description here

Which line are the two things I want? or when a new patients comes in, how to get that?

Thank you so much!

Micho
  • 3,929
  • 13
  • 37
  • 40
Yulai Wei
  • 1
  • 1
  • Display a graph using values from `time` as values for the x-axis, and values of `survival` for the y-axis. You will see a decreasing curve. You will not be able to answer questions for a specific individual (your two questions), but about the group. For example, at what time does half the population remain (look at the x value corresponding to y=0,5). For questions relating to "when a patient comes in", in survival analysis, all persons start at time 0 (relative time), even if this does not represent the same day. Hope that helps. – Sci Prog Jul 05 '17 at 03:06
  • Tahnk you. Good to know. – Yulai Wei Jul 06 '17 at 01:32

0 Answers0