| batch_surv | R Documentation |
Performs Cox proportional hazards regression analysis on multiple variables. Optionally determines optimal cutoffs to dichotomize continuous predictors before modeling. Returns hazard ratios, confidence intervals, and p-values for each variable.
batch_surv(
pdata,
variable,
time = "time",
status = "status",
best_cutoff = FALSE
)
pdata |
Data frame containing survival time, event status, and predictor variables. |
variable |
Character vector specifying the names of predictor variables to analyze. |
time |
Character string specifying the column name containing follow-up time. Default is '"time"'. |
status |
Character string specifying the column name containing event status (1 = event occurred, 0 = censored). Default is '"status"'. |
best_cutoff |
Logical indicating whether to compute optimal cutoffs for continuous variables and analyze dichotomized versions. Default is 'FALSE'. |
Data frame containing hazard ratios (HR), 95 and p-values for each variable, sorted by p-value.
Dongqiang Zeng
# Create small example data
set.seed(123)
test_data <- data.frame(
OS_time = runif(100, 0, 100),
OS_status = sample(c(0, 1), 100, replace = TRUE),
Signature1 = rnorm(100),
Signature2 = rnorm(100)
)
batch_surv(
pdata = test_data,
variable = c("Signature1", "Signature2"),
time = "OS_time",
status = "OS_status"
)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.