AvgHazardRatios: Pre and post-crossing average hazard ratios

View source: R/AvgHazardRatios.R

AvgHazardRatiosR Documentation

Pre and post-crossing average hazard ratios

Description

This function computes the average treatment-to-total hazard ratio for the time periods before and after a crossing occurs.

Usage

AvgHazardRatios(obj)

Arguments

obj

An object of class surv.delay

Details

The crossing time can either represent a crossing of the survival functions or a crossing a crossing of the hazard functions. If one wants to use a crossing time of the survival functions, make sure the surv.delay object was obtained from running the DelayedSurvFit function. Likewise, if one wants to use a crossing time of the hazard functions, make sure the surv.delay object was obtained from running the DelayedHazFit function.

Value

A list with the following two components

precross.avg

Average treatment-to-total hazard ratio before the crossing time

postcross.avg

Average treatment-to-total hazard ratio after the crossing time

Author(s)

Nicholas Henderson

Examples

set.seed(5172)

### Generate simulated survival data
n <- 400
cens.time <- 8
X1 <- rweibull(n, shape=2.3, scale=7)
X2 <- rweibull(n, shape=.8, scale=10)
Y1 <- pmin(X1, cens.time)
Y2 <- pmin(X2, cens.time)
e1 <- as.numeric(X1 < cens.time)
e2 <- as.numeric(X2 < cens.time)

times <- c(Y1, Y2)  ## follow-up times
events <- c(e1, e2) ## event indicators
trt <- rep(c(0,1), each=n)  ## treatment arm assignment

dhz.obj <- DelayedHazFit(times, events, trt, max.times=50) 

AvgHazardRatios(dhz.obj)

nchenderson/DelayedSurvFit documentation built on Aug. 18, 2024, 11:49 a.m.