Compare quantiles of two independent samples (ratio or difference) based on (weighted-) Kaplan-Meier estimator
wkmCompareQuantiles(tau, formula, data, conf.level = 0.95,
null.value = 1, method = "ratio", p.value = FALSE)
number between 0 and 1 specifying the quantile
an object of class '"formula"' specifying the conditional survival model
data frame containing the variables in formula
confidence level (or NULL if no confidence interval should be calculated)
true value of quantile ratio or difference
either '"ratio"' or '"difference"'
if TRUE p.value will be calculated (requires null.value)
An object of class '"survQuantile"', i.e. a list containing the estimated quantiles, confidence interval and p.value (if p.value = TRUE)
su_nonparametric_1993
# 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)) # treatment indicator
wkmCompareQuantiles(0.5, Surv(Y, D) ~ Z, data.frame(Y=Y, D=D, Z=Z))
# }
Run the code above in your browser using DataLab