Part a. R code:
library(survival)
t <- c(50, 51, 66, 82, 92, 120, 120, 120,
63, 65, 69, 69, 79, 82, 82, 120)
d <- c( 1, 1, 0, 1, 1, 0, 0, 0,
1, 1, 1, 1, 1, 1, 1, 0)
g <- c(rep(1, 8), rep(2, 8))
km_fit <- survfit(Surv(t, d) ~ g)
plot(km_fit,
col = c("steelblue", "tomato"),
lty = c(1, 2),
lwd = 2,
conf.int = TRUE,
xlab = "Operating time (minutes)",
ylab = "Probability of not yet achieving result",
main = "KM curves: Robot vs Traditional surgery")
legend("bottomleft",
legend = c("Group 1 (Robot)", "Group 2 (Traditional)"),
col = c("steelblue", "tomato"),
lty = c(1, 2), lwd = 2)
Part b. The two KM curves cross: the robot-assisted curve (Group 1) is lower at the start (the first two results are achieved at 50 and 51 minutes), the curves meet at \(t=65\) (both \(\hat S=0.75\)), and from then on the traditional curve (Group 2) lies below the robot curve. Since a lower curve means the result is achieved sooner, the traditional approach is faster for most of the follow-up, and the gap widens towards 120 minutes. Group 1 has a higher censoring rate (4/8 censored, three at 120 min and one at 66 min, vs 1/8 for Group 2). The confidence intervals overlap substantially throughout, suggesting the visual difference may not be statistically significant — a formal test is needed.