surv2.logrank {surv2sample} | R Documentation |
Compares the distribution of survival times in two samples of censored data using the weighted logrank test with the G(rho,gamma) class of weights, or combinations (maximum or weighted sum) of several weighted logrank statistics.
surv2.logrank(x, group, rho.gamma = c(0, 0), comb, sum.weights, approx = "perm", nsim = 2000, choltol = 1e-07)
x |
a "Surv" object, as returned by the Surv
function. |
group |
a vector indicating to which group each observation belongs. May contain values 1 and 2 only. |
rho.gamma |
parameters (rho,gamma) of the weight. This must be a vector of length 2 or a list of vectors of length 2. |
comb |
the method of combining test statistics. Possible values
are "max" and "sum" . comb is ignored, if there is
only one set of parameters in rho.gamma , and defaults to "max"
otherwise. |
sum.weights |
weights for the weighted sum in the "sum"
combination method. Defaults to equal weights for all statistics. |
approx |
the method of approximating the distribution of the
test statistic. Possible values are "perm" for permutations,
"boot" for the bootstrap, "asympt" for asymptotics. |
nsim |
the number of simulations. This means the number of
permutations or bootstrap samples when approx is
"perm" or "boot" . When approx is "asympt" ,
nsim is the number of simulations to approximate the asymptotic
distribution (only needed for combination methods). |
choltol |
a tolerance parameter for the Cholesky decomposition. |
The logrank test uses G(rho,gamma) weights defined as S(t)^rho (1-S(t))^gamma, where S(t) is the Kaplan–Meier estimate computed from the pooled sample.
Combination tests are based on a cluster of several weighted logrank statistics with different parameters (rho,gamma). The maximum statistic uses the maximum of absolute values of standardised statistics. The sum statistic uses the weighted sum of absolute values of standardised statistics. See Chapter 7 of Fleming and Harrington (1991) for details.
A list of class "surv2.logrank"
with components:
stat |
the test statistic. |
pval |
the p-value. |
rho.gamma |
as on input (for a test using a single statistic). |
stats |
a matrix containing parameters of weights, corresponding statistics and p-values (for a combination test). |
Further components include approx
, nsim
, comb
,
sum.weights
from input.
David Kraus (http://www.davidkraus.net/)
Andersen, P. K., Borgan, O., Gill, R. D. and Keiding, N. (1993) Statistical Models Based on Counting Processes. Springer, New York.
Fleming, T. R. and Harrington, D. P. (1991) Counting Processes and Survival Analysis. Wiley, New York.
surv2.neyman
, surv2.ks
,
survdiff
, survfit
## gastric cancer data data(gastric) ## Prentice--Wilcoxon (G^1) test surv2.logrank(Surv(gastric$time, gastric$event), gastric$treatment, rho.gamma = c(1,0)) ## combination of G(0,0), G(1,0), G(1,1) statistics ## maximum test print(a <- surv2.logrank(Surv(gastric$time, gastric$event), gastric$treatment, rho.gamma = list(c(0,0), c(1,0), c(1,1)), comb = "max")) ## print individual statistics a$stats