View source: R/getHRandCIfromCoxph.R
getHRandCIfromCoxph | R Documentation |
This convenience function extracts hazard ratio and confidence intervals from a coxph object, as generated by a call to coxph(), comparing survival times between two groups.
getHRandCIfromCoxph(coxphData)
coxphData |
coxph object; example usage: ## Not run: library(survival) # Create example data set.seed(123) df <- data.frame( TTE = rexp(200, rate = 0.1), # Time to event data Cens = rbinom(200, size = 1, prob = 0.7), # Censoring information group = sample(c("Treatment", "Control"), 200, replace = TRUE) # Group information ) # Fit Cox proportional hazards model coxphData <- coxph(Surv(TTE, Cens) ~ group, data = df) # Extract HR and CI results <- getHRandCIfromCoxph(coxphData) print(results) ## End(Not run) |
Dorothee Nickles
Dongqiang Zeng
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.