I have constructed a survival function such as:
[![plot(survfit(Surv(inf.time,infection)~1),xlab="Time (days)",ylab="Survival Probability",
main="Time Until Staphylococcus Infection",
conf.int = F)][1]][1]
Now i would like to determine by which time has 40% of the patients had an infection? How can this be written in R? Either as a command that gives me a numerical value as result or directly plotted into the survival function graph.
I am aware that the survival function depicts the probability of not having an infection, therefore i can read from the graph that survival probability of 0.6 corresponds to ca. 45 days? How can i plot this into the graph?
i tried (with no luck):
inf.time[which(survfit(Surv(inf.time,infection)~1) == 0.6)]