Package 'GFDrmst'

Title: Multiple RMST-Based Tests in General Factorial Designs
Description: We implemented multiple tests based on the restricted mean survival time (RMST) for general factorial designs as described in Munko et al. (2024) <doi:10.1002/sim.10017>. Therefore, an asymptotic test, a groupwise bootstrap test, and a permutation test are incorporated with a Wald-type test statistic. The asymptotic and groupwise bootstrap test take the asymptotic exact dependence structure of the test statistics into account to gain more power. Furthermore, confidence intervals for RMST contrasts can be calculated and plotted and a stepwise extension that can improve the power of the multiple tests is available.
Authors: Marc Ditzhaus [aut], Dennis Dobler [aut], Marc Kindop [aut], Merle Munko [aut, cre]
Maintainer: Merle Munko <[email protected]>
License: GPL (>= 3)
Version: 0.1.1
Built: 2025-02-25 05:16:28 UTC
Source: https://github.com/cran/GFDrmst

Help Index


A Shiny app for multiple RMST-based tests

Description

This function provides a shiny app for performing multiple RMST-based tests. Here, the asymptotic, groupwise bootstrap or permutation test can be applied.

Usage

GFDrmstGUI()

Details

Note that the calculations for the groupwise bootstrap and the permutation test may take a while, especially with stepwise extension.

Value

No return value, called for side effects.


Plot simultaneous confidence intervals for a GFDrmst object

Description

Simultaneous confidence intervals for the linear combinations of restricted mean survival times are plotted.

Usage

## S3 method for class 'GFDrmst'
plot(x, ...)

Arguments

x

An object of class "GFDrmst", usually a result of a call to RMST.test.

...

Further arguments are ignored.

Details

The displayed vectors on the y-axis are the coefficients H\mathbf{H}_{\ell} for the linear combinations of the RMSTs.

Value

No return value, called for side effects.

See Also

RMST.test

Examples

data(colonCS, package = "condSURV")

out <- RMST.test(formula = "Stime ~ rx",
                 event = "event",
                 data = colonCS,
                 hyp_mat = "Tukey",
                 tau = 3000,
                 method = "asymptotic")
plot(out)

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 NULL. Either time, status, group or formula, event, data needs to be specified.

status

A vector of the same length as time containing the corresponding censoring status indicator with values 0 = censored and 1 = uncensored. Default option is NULL. Either time, status, group or formula, event, data needs to be specified.

group

A vector of the same length as time containing the corresponding group labels. Default option is NULL. Either time, status, group or formula, event, data needs to be specified.

formula

A model formula object. The left hand side contains the time variable and the right hand side contains the factor variables of interest. Default option is NULL. Either time, status, group or formula, event, data needs to be specified.

event

The name of censoring status indicator with values 0 = censored and 1 = uncensored. Default option is NULL. Either time, status, group or formula, event, data needs to be specified.

data

A data.frame or list containing the variables in formula and the censoring status indicator. Default option is NULL. Either time, status, group or formula, event, data needs to be specified.

hyp_mat

A list containing all the hypothesis matrices H for the multiple tests or one of the options "Tukey", "Dunnett", "center", "crossed factorial" or a matrix if only one hypothesis is of interest. The option "crossed factorial" is only available if formula is specified. For the permutation test, all matrices need to be contrast matrices.

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 (NULL), all hypothesis vectors are set to zero vectors of suitable length.

tau

A numeric value specifying the end of the relevant time window for the analysis. Default option is NULL.

method

One of the methods "groupwise", "permutation" and "asymptotic" that should be used for calculating the critical values. Default option is "groupwise".

stepwise

A logical vector indicating whether a stepwise extension of the test should be performed. If TRUE, no confidence intervals can be computed for the linear combinations but it may be that more tests can reject. Default option is FALSE.

alpha

A numeric value specifying the global level of significance. Default option is 0.05.

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 4999.

seed

A single value, interpreted as an integer, for providing reproducibility of the results or NULL if reproducibility is not wanted. Default option is 1.

Details

The restricted mean survival time (RMST) of group ii is defined as

μi:=0τSi(t)dt\mu_i := \int\limits_0^{\tau} S_i(t) \mathrm{d}t

for all i{1,...,k}i\in\{1,...,k\}, where SiS_i denotes the survival function of group ii. Let

μ:=(μ1,...,μk)\boldsymbol{\mu} := (\mu_1,...,\mu_k)^{\prime}

be the vector of the RMSTs and

μ^:=(μ^1,...,μ^k)\widehat{\boldsymbol{\mu}} := (\widehat{\mu}_1,...,\widehat{\mu}_k)^{\prime}

be the vector of their estimators. Let HI ⁣Rr×k\mathbf{H}_{\ell} \in {\rm I\!R}^{r_{\ell}\times k} with rank(H)>0\mathrm{rank}(\mathbf{H}_{\ell}) >0 and cI ⁣Rr\mathbf{c}_{\ell} \in {\rm I\!R}^{r_{\ell}} for all {1,...,L}\ell\in\{1,...,L\}. We are considering the multiple testing problem with null and alternative hypotheses

H0,:Hμ=cvs.H1,:Hμc,for{1,...,L}.\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\}.

For the permutation test, all matrices H1,...,HL\mathbf{H}_{1},...,\mathbf{H}_{L} specified in hyp_mat need to be contrast matrices. The following options are already implemented for hyp_mat. "Tukey", "Dunnett" or "center" lead to Tukey's or Dunnett's contrasts or the centering matrix, respectively. If formula is specified, the option "crossed factorial" is also available to test simultaneously on main/interaction effects of a crossed factorial design; cf. Example 1 in Munko et al. (2024) for the crossed two-way design.

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 = FALSE), Wald-type test statistics, critical values and the test decisions.

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)

## an example for a crossed two-way design
out_tw <- RMST.test(formula = "Stime ~ rx * sex",
                    event = "event",
                    data = colonCS,
                    hyp_mat = "Tukey",
                    tau = 3000,
                    method = "asymptotic")
summary(out_tw)
plot(out_tw)


# 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)

Summarizing RMST-based multiple testing output

Description

summary method for class "GFDrmst".

Usage

## S3 method for class 'GFDrmst'
summary(object, digits = 8,...)

Arguments

object

An object of class "GFDrmst", usually a result of a call to RMST.test.

digits

An integer indicating the number of decimal places to be used. Default option is 8.

...

Further arguments are ignored.

Details

The function prints the information about the used method, significance level, hypothesis matrices, Wald-type test statistics, adjusted p-values and the overall results of the tests.

Value

No return value, called for side effects.

See Also

RMST.test

Examples

data(colonCS, package = "condSURV")

out <- RMST.test(formula = "Stime ~ rx",
                 event = "event",
                 data = colonCS,
                 hyp_mat = "Tukey",
                 tau = 3000,
                 method = "asymptotic")
summary(out, digits = 3)