Fits a univariate Cox proportional hazards model for time-to-event data using a categorical predictor. Reports hazard ratios (HR), 95% CI, Wald p-values for 2-category variables, and likelihood ratio test (LRT) results for variables with >2 categories.

cox_univar_fun(data_fun, res_time, res_event, var)

Arguments

data_fun

Data frame containing survival data.

res_time

Character. Name of survival time variable.

res_event

Character. Name of event indicator (1 = event, 0 = censored).

var

Character. Categorical predictor variable.

dig

Rounding digits.

Value

A matrix of HRs, CIs, and p-values.

Examples

if (FALSE) { # \dontrun{
cox_univar_fun(mydata, "OS_time", "OS_event", "Stage")
} # }