wkmCompareQuantiles: wkmCompareQuantiles

Description Usage Arguments Value References Examples

View source: R/quantiles.R

Description

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

Usage

1
2
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

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)) # treatment indicator
wkmCompareQuantiles(0.5, Surv(Y, D) ~ Z, data.frame(Y=Y, D=D, Z=Z))

mbrueckner/AHR documentation built on Dec. 5, 2018, 4:12 p.m.