View source: R/getHRandCIfromCoxph.R
| getHRandCIfromCoxph | R Documentation |
Extracts hazard ratio (HR) and 95 Cox proportional hazards model.
getHRandCIfromCoxph(coxphData)
coxphData |
Fitted Cox model object from 'survival::coxph()'. |
Data frame with p-values, HR, and confidence intervals.
Dorothee Nickles
Dongqiang Zeng
library(survival)
set.seed(123)
df <- data.frame(
TTE = rexp(200, rate = 0.1),
Cens = rbinom(200, size = 1, prob = 0.7),
group = sample(c("Treatment", "Control"), 200, replace = TRUE)
)
coxphData <- survival::coxph(survival::Surv(TTE, Cens) ~ group, data = df)
results <- getHRandCIfromCoxph(coxphData)
print(results)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.