Description Usage Arguments Value References See Also Examples
Estimate average hazard ratios from k independent samples based on the Aalen-Johansen estimator of the empirical transition probabilities (NOTE: variance estimation not yet implemented)
1 2 |
L |
time-limit specifying time-interval [0,L] over which average hazard ratios will be calculated |
target |
string specifying the target transition, for which the Aalen-Johansen estimator is to be calculated |
states |
list of state names |
transitions |
matrix of possible transitions |
censoring |
name of censoring 'state' |
data |
data frame containing variables id, time, from, to (see |
null.theta |
vector specifying the null hypothesis for the average hazard ratios |
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 |
number of bootstrap samples to draw for variance estimation (default: 0 = no bootstrap, direct variance estimation). This parameter is ignored if cov=TRUE |
An object of class '"ahr"'
J.~D. Kalbfleisch and R.~L. Prentice. Estimation of the average hazard ratio. Biometrika, 68(1):105–112, Apr. 1981.
1 2 3 4 5 6 7 8 9 10 11 12 13 | ## competing risks
Trt <- factor(rep(c(0,1), c(100, 100)))
T <- c(rexp(100, 1), rexp(100, 2))
C <- c(rexp(100, 1), rexp(100, 2))
r <- c(rbinom(100, 2, 0.5), rbinom(100, 2, 0.4))
r[(r == 0) | (T > C)] <- "cens"
data <- data.frame(id=1:200, time=pmin(T,C), from=rep(0, 200), to=r, Trt=Trt)
tra <- matrix(FALSE, nrow=3, ncol=3)
tra[1, 2:3] <- TRUE
# estimate average subdistribution hazard ratio up to L=2 for event type 1
fit <- ahrAJ(2, target="0 1", states=c("0", "1", "2"), transitions=tra, censoring="cens",
data=data, cov=TRUE)
fit
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.