avgHR: avgHR

Description Usage Arguments Details Value References See Also Examples

View source: R/ahr.R

Description

Estimate average hazard ratios from k independent samples

Usage

1
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

Details

This function is a simple wrapper for ahrWKM and ahrAJ.

Value

An object of class '"ahr"'

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

1
2
3
4
5
6
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)

mbrueckner/AHR documentation built on May 22, 2017, 12:16 a.m.