comp {survMisc} | R Documentation |
compare survival curves
Description
compare survival curves
Usage
comp(x, ...)
## S3 method for class 'ten'
comp(x, ..., p = 1, q = 1, scores = seq.int(attr(x, "ncg")), reCalc = FALSE)
Arguments
x |
A |
... |
Additional arguments (not implemented). |
p |
|
q |
|
scores |
scores for tests for trend |
reCalc |
Recalcuate the values?
|
Details
The log-rank tests are formed from the following elements, with values for each time where there is at least one event:
-
, the weights, given below.
-
, the number of events (per time).
-
, the number of predicted events, given by
predict
. -
, the covariance matrix for time
, given by
COV
.
It is calculated as:
If there are groups, then
are selected (arbitrary).
Likewise the corresponding variance-covariance matrix is reduced to the
appropriate dimensions.
is distributed as chi-square with
degrees of freedom.
For covariate groups, we can use:
-
the number of events (per time).
-
the number at risk overall.
-
the number of events in group
.
-
the number at risk in group
.
Then:
Below, for the Fleming-Harrington weights,
is the Kaplan-Meier (product-limit) estimator.
Note that both and
need to be
.
The weights are given as follows:
| log-rank | |
| Gehan-Breslow generalized Wilcoxon | |
| Tarone-Ware | |
| Peto-Peto's modified survival estimate |
|
| modified Peto-Peto (by Andersen) |
|
| Fleming-Harrington |
The weight at and thereafter is:
|
The supremum (Renyi) family of tests are designed
to detect differences in survival curves which cross.
That is, an early difference in survival in favor of one group
is balanced by a later reversal.
The same weights as above are used.
They are calculated by finding
(which is similar to the numerator used to find
in the log-rank test for 2 groups above).
and it's variance:
where is the largest
where both groups have at least one subject at risk.
Then calculate:
When the null hypothesis is true,
the distribution of is approximately
And for a standard Brownian motion (Wiener) process:
Tests for trend are designed to detect ordered differences in survival curves.
That is, for at least one group:
where is the largest
where all groups have at least one subject at risk.
The null hypothesis is that
Scores used to construct the test are typically ,
but may be given as a vector representing a numeric characteristic of the group.
They are calculated by finding:
The test statistic is:
where is the the appropriate element in the
variance-covariance matrix (see
COV
).
If ordering is present, the statistic will be greater than the
upper
-th
percentile of a standard normal distribution.
Value
The tne
object is given
additional attributes
.
The following are always added:
lrt |
The log-rank family of tests |
lrw |
The log-rank weights (used in calculating the tests). |
An additional item depends on the number of covariate groups.
If this is :
sup |
The supremum or Renyi family of tests |
and if this is :
tft |
Tests for trend. This is given as a |
Note
Regarding the Fleming-Harrington weights:
-
gives the log-rank test, i.e.
-
gives a version of the Mann-Whitney-Wilcoxon test (tests if populations distributions are identical)
-
gives more weight to differences later on
-
gives more weight to differences early on
The example using alloauto
data illustrates this.
Here the log-rank statistic
has a p-value of around 0.5
as the late advantage of allogenic transplants
is offset by the high early mortality. However using
Fleming-Harrington weights of ,
emphasising differences later in time, gives a p-value of 0.04.
Stratified models (stratTen
) are not yet supported.
References
Gehan A. A Generalized Wilcoxon Test for Comparing Arbitrarily Singly-Censored Samples. Biometrika 1965 Jun. 52(1/2):203–23. ‘http://www.jstor.org/stable/2333825’ JSTOR
Tarone RE, Ware J 1977 On Distribution-Free Tests for Equality of Survival Distributions. Biometrika;64(1):156–60. ‘http://www.jstor.org/stable/2335790’ JSTOR
Peto R, Peto J 1972 Asymptotically Efficient Rank Invariant Test Procedures. J Royal Statistical Society 135(2):186–207. ‘http://www.jstor.org/stable/2344317’ JSTOR
Fleming TR, Harrington DP, O'Sullivan M 1987 Supremum Versions of the Log-Rank and Generalized Wilcoxon Statistics. J American Statistical Association 82(397):312–20. ‘http://www.jstor.org/stable/2289169’ JSTOR
Billingsly P 1999 Convergence of Probability Measures. New York: John Wiley & Sons. ‘http://dx.doi.org/10.1002/9780470316962’ Wiley (paywall)
Examples
## Two covariate groups
data("leukemia", package="survival")
f1 <- survfit(Surv(time, status) ~ x, data=leukemia)
comp(ten(f1))
## K&M 2nd ed. Example 7.2, Table 7.2, pp 209--210.
data("kidney", package="KMsurv")
t1 <- ten(Surv(time=time, event=delta) ~ type, data=kidney)
comp(t1, p=c(0, 1, 1, 0.5, 0.5), q=c(1, 0, 1, 0.5, 2))
## see the weights used
attributes(t1)$lrw
## supremum (Renyi) test; two-sided; two covariate groups
## K&M 2nd ed. Example 7.9, pp 223--226.
data("gastric", package="survMisc")
g1 <- ten(Surv(time, event) ~ group, data=gastric)
comp(g1)
## Three covariate groups
## K&M 2nd ed. Example 7.4, pp 212-214.
data("bmt", package="KMsurv")
b1 <- ten(Surv(time=t2, event=d3) ~ group, data=bmt)
comp(b1, p=c(1, 0, 1), q=c(0, 1, 1))
## Tests for trend
## K&M 2nd ed. Example 7.6, pp 217-218.
data("larynx", package="KMsurv")
l1 <- ten(Surv(time, delta) ~ stage, data=larynx)
comp(l1)
attr(l1, "tft")
### see effect of F-H test
data("alloauto", package="KMsurv")
a1 <- ten(Surv(time, delta) ~ type, data=alloauto)
comp(a1, p=c(0, 1), q=c(1, 1))