Learn R Programming

AHR (version 1.5.0)

wkmQuantile: wkmQuantile

Description

Estimate arbitrary quantiles of a survival distribution based on the (weighted) Kaplan-Meier

Usage

wkmQuantile(tau, formula, data, conf.level = 0.95, null.value = NULL,
  rr.subset = rep(TRUE, nrow(data)))

Arguments

tau

number between 0 and 1 specifiying the quantile to estimate

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 or NULL if no p-value should be calculated

rr.subset

logical vector defining subset of observations to use for response rate estimation (default: use all observations)

Value

An object of class '"survQuantile"'

References

brookmeyer_confidence_1982

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))
wkmQuantile(0.5, Surv(Y, D) ~ strata(Z), data.frame(Y=Y, D=D, Z=Z))
# }

Run the code above in your browser using DataLab