hr.comp {survcomp} | R Documentation |
This function compares two hazard ratios from their betas and standard errors as computed by a Cox model for instance. The statistical test is a Student t test for dependent samples. The two hazard ratios must be computed from the same survival data.
hr.comp(hr1, hr2)
hr1 |
first hazard ratio. |
hr2 |
second hazard ratio. |
The two hazard ratios must be computed from the same samples (and corresponding survival data). The function uses a Student t test for dependent samples.
p.value |
p-value from the Student t test for the comparison beta1 > beta2 (equivalently hr1 > hr2) |
hr1 |
value of the first hazard ratio |
hr2 |
value of the second hazard ratio |
Benjamin Haibe-Kains
Student 1908) "The Probable Error of a Mean", Biometrika, 6, 1, pages 1–25.
Haibe-Kains, B. and Desmedt, C. and Sotiriou, C. and Bontempi, G. (2008) "A comparative study of survival models for breast cancer prognostication based on microarray data: does a single gene beat them all?", Bioinformatics, 24, 19, pages 2200–2208.
require(survival) set.seed(12345) age <- as.numeric(rnorm(100, 50, 10) >= 50) size <- as.numeric(rexp(100,1) > 1) stime <- rexp(100) cens <- runif(100,.5,2) sevent <- as.numeric(stime <= cens) stime <- pmin(stime, cens) hr1 <- hazard.ratio(x=age, surv.time=stime, surv.event=sevent) hr2 <- hazard.ratio(x=size, surv.time=stime, surv.event=sevent) hr.comp(hr1=hr1, hr2=hr2)