Learn R Programming

AHR (version 1.5.0)

wkmCompareQuantiles: wkmCompareQuantiles

Description

Compare quantiles of two independent samples (ratio or difference) based on (weighted-) Kaplan-Meier estimator

Usage

wkmCompareQuantiles(tau, formula, data, conf.level = 0.95,
  null.value = 1, method = "ratio", p.value = FALSE)

Arguments

tau

number between 0 and 1 specifying the quantile

formula

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

data

data frame containing the variables in formula

conf.level

confidence level (or NULL if no confidence interval should be calculated)

null.value

true value of quantile ratio or difference

method

either '"ratio"' or '"difference"'

p.value

if TRUE p.value will be calculated (requires null.value)

Value

An object of class '"survQuantile"', i.e. a list containing the estimated quantiles, confidence interval and p.value (if p.value = TRUE)

References

su_nonparametric_1993

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)) # 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