install.packages("timeROC") library(timeROC) data <- data.frame( Gene = rep(c("OA", "Normal"), each = 8), NEK2 = c(29.04, 13.42, 13.69, 14.76, 75.66, 28.1, 16.75, 16.63, 20.66, 15.45, 11.19, 11.29, 13.38, 16.6, 11.51, 23.91) ) surv_data <- with(data, Surv(rep(1:8, 2), event = as.numeric(Gene == "OA"))) roc_result <- timeROC(surv_data, data$NEK2) plot(roc_result$roc, main = "timeROC Curve", col = "yellow", lwd = 2) abline(a = 0, b = 1, lty = 2) legend("bottomright", legend = "NEK2", col = "yellow", lwd = 2)