Learn R Programming

AHR (version 1.5.0)

avgHR: avgHR

Description

Estimate average hazard ratios from k independent samples

Usage

avgHR(L, data, method = "km", ...)

Arguments

L

time-limit specifying time-interval [0,L] on which average hazard ratios will be calculated

data

data frame (see data argument to ahrWKM (if method == "wkm" || "km") or ahrAJ (if method == "aj"))

method

method used for estimating survival functions (default: Kaplan-Meier estimator)

...

additional arguments passed to ahrWKM or ahrAJ

Value

An object of class '"ahr"'

Details

This function is a simple wrapper for ahrWKM and ahrAJ.

References

J.~D. Kalbfleisch and R.~L. Prentice. Estimation of the average hazard ratio. Biometrika, 68(1):105--112, Apr. 1981.

See Also

ahrWKM, ahrAJ

Examples

Run this code
# NOT RUN {
T <- c(rexp(100, 1), rexp(100, 2))
C <- c(rexp(100, 1), rexp(100, 2))
Y <- pmin(T, C)
D <- T <= C
Z <- rep(c(0,1), c(100, 100))
fit <- avgHR(2, data.frame(Y=Y, D=D, Z=Z), formula=Surv(Y, D) ~ Z)
# }

Run the code above in your browser using DataLab