| Surv | R Documentation |
Create a survival object, usually used as a response variable in a
model formula. Argument matching is special for this function, see
Details under Surv. This is a restricted wrapper around
Surv and currently supports only right-censored data.
Surv(...)
... |
arguments to be passed into |
An object of class "Surv".
Therneau T (2024). A Package for Survival Analysis in R. R package version 3.8-3, https://CRAN.R-project.org/package=survival.
set.seed(2025)
N = 300
test_data =
data.frame(outcome =
rweibull(N,2,5))
test_data$observed =
ifelse(test_data$outcome >= 7, 0, 1)
test_data$outcome =
ifelse(dplyr::near(test_data$observed,1), test_data$outcome, 7)
Surv(test_data$outcome,
test_data$observed)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.