## ----include = FALSE---------------------------------------------------------- knitr::opts_chunk$set( collapse = TRUE, comment = "#>", eval = FALSE ) ## ----------------------------------------------------------------------------- # library(reticulate) # use_virtualenv("survivalGPU") # the Python environment, see below # # library(survivalGPU) # library(survival) # # use_cuda() # TRUE if a GPU is detected, FALSE if survivalGPU runs on CPU # # data <- lung # data$status <- data$status - 1 # event coded as 0/1 # data$id <- seq_len(nrow(data)) # one row per patient # # fit <- coxphGPU(Surv(time, status) ~ age + sex, data = data, # x = TRUE, patient_id = "id") # both needed by bootstrap() # fit <- bootstrap(fit, R = 100) # summary(fit) # with bootstrap confidence intervals