survdiff(formula, data, subset, na.action, rho=0)
Surv(time, status) ~ predictors
. For a one-sample test, the predictors
must consist of a single
offset(sp)
term, where
sp
is a vector giving the
survival probability of each subject. For a k-sample test, each unique
combination of predictors defines a subgroup.
A
strata
term may be used to produce a stratified test.
To cause missing values in the predictors to be treated as a separate
group, rather than being omitted, use the
strata
function with its
na.group=T
argument.
model.frame
after any
subset argument has been used. Default is
options()$na.action
.
This function implements the G-rho family of
Harrington and Fleming (1982), with weights on each death of (S(t))^rho,
where S is the Kaplan-Meier estimate of survival.
When
rho = 0
this is the log-rank or Mantel-Haenszel test,
and when
rho = 1
it is equivalent to the Peto & Peto modification
of the Gehan-Wilcoxon test.
If the right hand side of the formula consists only of an offset term,
then a one sample test is done.
To cause missing values in the predictors to be treated as a separate
group, rather than being omitted, use the
factor
function with its
exclude
argument.
Harrington, D. P. and Fleming, T. R. (1982). A class of rank test procedures for censored survival data. Biometrika 69, 553-566.
survdiff(Surv(time, status) ~ group, data=leukemia)