ahrKM: ahrKM

Description Usage Arguments Value References See Also Examples

Description

Estimate average hazard ratios from k independent samples based on the Kaplan-Meier estimator

Usage

1
2
3
ahrKM(L, formula, data, null.theta = NULL, contrast = NULL,
  multi.test = FALSE, cov = TRUE, bootstrap = 0,
  left.limit = FALSE)

Arguments

L

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

formula

an object of class '"formula"' specifying the conditional survival model

data

data frame containing the variables in formula

null.theta

vector specifying the null hypothesis for the average hazard ratios (H_0: theta = null.theta)

contrast

vector of contrasts to test H_0: contrast * (theta - null.theta) = 0

multi.test

calculate multivariate test statistic if TRUE

cov

if TRUE calculate covariance matrix estimator (direct)

bootstrap

if > 0 then use bootstrap to estimate covariance matrix (ignore if cov is TRUE)

left.limit

if TRUE use left-continuous interpolation of WKM estimates

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

survfit

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
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)) # treatment indicator
fit <- ahrKM(2, Surv(Y, D) ~ Z, data.frame(Y=Y, D=D, Z=Z))
fit

## the same as above, but estimate covariance matrix using bootstrap
## Not run: fitBS <- ahrKM(2, Surv(Y, D) ~ Z, data.frame(Y=Y, D=D, Z=Z), cov=FALSE,
                         bootstrap=1000)
## End(Not run)

mbrueckner/AHR documentation built on May 22, 2019, 12:57 p.m.