RMST.test {GFDrmst} | R Documentation |
Function to perform multiple RMST-based tests
Description
Linear hypotheses of the restricted mean survival times (RMSTs) of k different groups can be tested simultaneously.
Therefore, the multivariate distribution of local Wald-type test statistics is approximated by (1) estimating the covariance between the test statistics (method = "asymptotic"
), (2) a groupwise bootstrap procedure (method = "groupwise"
) or (3) a permutation approach (method = "permutation"
), respectively. Hence, adjusted p-values can be obtained.
Usage
RMST.test(
time = NULL,
status = NULL,
group = NULL,
formula = NULL,
event = NULL,
data = NULL,
hyp_mat,
hyp_vec = NULL,
tau,
method = c("groupwise", "permutation", "asymptotic"),
stepwise = FALSE,
alpha = 0.05,
Nres = 4999,
seed = 1
)
Arguments
time |
A vector containing the observed event times. Default option is |
status |
A vector of the same length as |
group |
A vector of the same length as |
formula |
A model |
event |
The name of censoring status indicator with values 0 = censored and 1 = uncensored. Default option is |
data |
A data.frame or list containing the variables in formula and the censoring status indicator. Default option is |
hyp_mat |
A list containing all the hypothesis matrices H for the multiple tests or one of the options |
hyp_vec |
A list containing all the hypothesis vectors c for the multiple tests or a vector if only one hypothesis is of interest. By default ( |
tau |
A numeric value specifying the end of the relevant time window for the analysis. Default option is |
method |
One of the methods |
stepwise |
A logical vector indicating whether a stepwise extension of the test should be performed. If |
alpha |
A numeric value specifying the global level of significance. Default option is |
Nres |
The number of random variables to approximate the limiting distribution. This is only used if at least one hypothesis matrix is not a row vector. The default option is |
seed |
A single value, interpreted as an integer, for providing reproducibility of the results or |
Details
The restricted mean survival time (RMST) of group i
is defined as
\mu_i := \int\limits_0^{\tau} S_i(t) \mathrm{d}t
for all i\in\{1,...,k\}
, where S_i
denotes the survival function of group i
.
Let
\boldsymbol{\mu} := (\mu_1,...,\mu_k)^{\prime}
be the vector of the RMSTs and
\widehat{\boldsymbol{\mu}} := (\widehat{\mu}_1,...,\widehat{\mu}_k)^{\prime}
be the vector of their estimators.
Let \mathbf{H}_{\ell} \in {\rm I\!R}^{r_{\ell}\times k}
with \mathrm{rank}(\mathbf{H}_{\ell}) >0
and \mathbf{c}_{\ell} \in {\rm I\!R}^{r_{\ell}}
for all \ell\in\{1,...,L\}
.
We are considering the multiple testing problem with null and alternative hypotheses
\mathcal{H}_{0,\ell}: \mathbf{H}_{\ell} \boldsymbol\mu = \mathbf{c}_{\ell} \quad \mathrm{vs.} \quad \mathcal{H}_{1,\ell}: \mathbf{H}_{\ell} \boldsymbol\mu \neq \mathbf{c}_{\ell}, \qquad \mathrm{for }\: \ell\in\{1,...,L\}.
If stepwise = TRUE
, the closed testing procedure is applied. In this case, no confidence intervals can be computed for the linear combinations but it may be that more tests can reject.
Note that the calculations for the groupwise bootstrap and the permutation test may take a while, especially with stepwise extension.
Value
A list of class GFDrmst
containing the following components:
method |
A character containing the method which has been used. |
test_stat |
A numeric vector containing the calculated Wald-type test statistics for the local hypotheses. |
p.value |
A numeric vector containing the adjusted p-values for the local hypotheses. |
res |
A list containing the results of the multiple tests including the hypothesis matrices, estimators of the linear combinations of RMSTs, potentially confidence intervals for the linear combinations (if all matrices are row vectors and stepwise = |
alpha |
A numeric value containing the global level of significance. |
References
Munko, M., Ditzhaus, M., Dobler, D., Genuneit, J. (2024). RMST-based multiple contrast tests in general factorial designs. Statistics in Medicine, 1-18. doi:10.1002/sim.10017
Examples
data(colonCS, package = "condSURV")
# multiple asymptotic tests
out <- RMST.test(formula = "Stime ~ rx",
event = "event",
data = colonCS,
hyp_mat = "Tukey",
tau = 3000,
method = "asymptotic")
summary(out)
plot(out)
## or, equivalently,
out <- RMST.test(time = colonCS$Stime,
status = colonCS$event,
group = colonCS$rx,
hyp_mat = "Tukey",
tau = 3000,
method = "asymptotic")
summary(out)
plot(out)
# multiple groupwise bootstrap tests
# this may take a few seconds
out_gw <- RMST.test(formula = "Stime ~ rx",
event = "event",
data = colonCS,
hyp_mat = "Tukey",
tau = 3000,
method = "groupwise")
summary(out_gw)
plot(out_gw)
# multiple permutation tests
# this may take a few seconds
out_perm <- RMST.test(formula = "Stime ~ rx",
event = "event",
data = colonCS,
hyp_mat = "Tukey",
tau = 3000,
method = "permutation")
summary(out_perm)
plot(out_perm)