getHRandCIfromCoxph: Extract hazard ratio and confidence intervals from a coxph...

View source: R/getHRandCIfromCoxph.R

getHRandCIfromCoxphR Documentation

Extract hazard ratio and confidence intervals from a coxph object

Description

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.

Usage

getHRandCIfromCoxph(coxphData)

Arguments

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)

Author(s)

Dorothee Nickles

Dongqiang Zeng


IOBR/IOBR documentation built on Sept. 9, 2024, 8:36 p.m.