TITLE(survdiff @@ Test Survival Curve Differences )
Tests if there is a difference between two or more survival curves using
the G-rho family of tests, or for a single curve against a known alternative.
USAGE(
survdiff(formula, data,  rho=0, subset)
)
ARGUMENTS(
ARG(formula@@)
a formula expression as for other survival models, of the form
LANG(Surv(time, status) ~ predictors).  For a one-sample test, the predictors
must consist of a single LANG(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 LANG(strata) term may be used to produce a stratified test.
ARG(data@@)
an optional data frame in which to interpret the variables occurring in the
formula.
ARG(rho@@)
a parameter that controls the type of test.
ARG(subset@@)
subset of the observations to be used in the fit.
)
PARA BOLD(VALUE)
a list with components:
ARGUMENTS(
ARG(n@@)
the number of subjects in each group.
ARG(obs@@)
the weighted observed number of events in each group.
If there are strata, this will be a matrix with one column per stratum.
ARG(exp@@)
the weighted expected number of events in each group.
If there are strata, this will be a matrix with one column per stratum.
ARG(chisq@@)
the chisquare statistic for a test of equality.
ARG(var@@)
the variance matrix of the test.
ARG(strata@@)
optionally, the number of subjects contained in each stratum.
)
PARA BOLD(METHOD)
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 LANG(rho = 0) this is the log-rank or Mantel-Haenszel test,
and when LANG(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 LANG(factor) function with its
LANG(exclude) argument.
PARA BOLD(REFERENCE)
Harrington, D. P. and Fleming, T. R. (1982).
A class of rank test procedures for censored survival data.
Biometrika
\(\backslash\)fB69\(\backslash\)fR, 553-566.
PARA BOLD(SEE ALSO)
LANG(survdiff.print).
BLANK

PARA BOLD( )
BLANK

EXAMPLES(
survdiff(Surv(futime, fustat) ~ rx)
survdiff(Surv(time, status) ~ pat.karno + strata(inst), data=cancer)
expect <- survexp(entry, birth, sex, futime)
survdiff(Surv(futime, fustat) ~ offset(expect\$surv))  #One sample log-rank
)
PARA ITALIC(File automatically converted from S(-PLUS) help format)
