Package 'GFDrmtl'

Title: Multiple RMTL-Based Tests for Competing Risks Data in General Factorial Designs
Description: We implemented multiple tests based on the restricted mean time lost (RMTL) for general factorial designs as described in Munko et al. (2024) <doi:10.48550/arXiv.2409.07917>. Therefore, an asymptotic test and a permutation test are incorporated with a Wald-type test statistic. The asymptotic test takes the asymptotic exact dependence structure of the test statistics into account to gain more power. Furthermore, confidence intervals for RMTL 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], Merle Munko [aut, cre], Jannes Walter [aut]
Maintainer: Merle Munko <[email protected]>
License: GPL (>= 3)
Version: 0.1.0
Built: 2024-11-03 05:21:46 UTC
Source: https://github.com/cran/GFDrmtl

Help Index


A Shiny app for multiple RMTL-based tests

Description

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

Usage

GFDrmtlGUI()

Details

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

Value

No return value, called for side effects.


Function to perform multiple RMTL-based tests

Description

Linear hypotheses of the restricted mean time losts (RMTLs) of k different groups in a competing risks setup 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") or (3) a permutation approach with Bonferroni-correction (method = "permutation"), respectively. Hence, adjusted p-values can be obtained.

Usage

RMTL.test(
  time = NULL,
  status = NULL,
  group = NULL,
  formula = NULL,
  event = NULL,
  data = NULL,
  hyp_mat,
  hyp_vec = NULL,
  M = NULL,
  tau,
  method = c("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 event indicator with values 0 = censored and 1,...,M for the M different competing events. 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,...,M for the M different competing events. 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" and "center" for Tukey's or Dunnett's contrasts or the centering matrix, respectively, or "2by2", "2by2 cause-wisely" for tests on main and interaction effects in a 2-by-2 design without or with cause-wise results, respectively, or a matrix if only one hypothesis is of interest. For the permutation test, all matrices need to fulfill the contrast property as described in Munko et al. (2024).

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.

M

An integer specifying the number of competing risks. By default (NULL), the maximum of the values in status or event is chosen.

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 time lost (RMTL) of group ii and event mm is defined as

μim:=0τFim(t)dt\mu_{im} := \int\limits_0^{\tau} F_{im}(t) \mathrm{d}t

for all i{1,...,k},m{1,...,M}i\in\{1,...,k\}, m\in\{1,...,M\}, where FimF_{im} denotes the cumulative incidence function of group ii and event mm. Let

μ:=(μ11,μ12,...,μkM)\boldsymbol{\mu} := (\mu_{11},\mu_{12},...,\mu_{kM})^{\prime}

be the vector of the RMTLs and

μ^:=(μ^11,μ^12,...,μ^kM)\widehat{\boldsymbol{\mu}} := (\widehat{\mu}_{11},\widehat{\mu}_{12},...,\widehat{\mu}_{kM})^{\prime}

be the vector of their estimators. Let HI ⁣Rr×kM\mathbf{H}_{\ell} \in {\rm I\!R}^{r_{\ell}\times kM} 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, the matrices additionally need to fulfill H(1kem)=0r\mathbf{H}_{\ell}(\mathbf{1}_k\otimes \mathbf{e}_m) = \mathbf{0}_{r_{\ell}} for all m,m, \ell, where 1kI ⁣Rk,emI ⁣RM,0rI ⁣Rr\mathbf{1}_k\in {\rm I\!R}^{k}, \mathbf{e}_m \in {\rm I\!R}^{M}, \mathbf{0}_{r_{\ell}} \in {\rm I\!R}^{r_{\ell}} denote the vector of ones, the mmth unit vector and the vector of zeros, respectively.

For the argument hyp_mat, the options "Dunnett" and "Tukey" create the cause-wise many-to-one and all-pairs comparisons, respectively, as described in Example 3 of Munko et al. (2024) and the options "2by2" and "2by2 cause-wisely" create the hypothesis matrices as described in Example 4 of Munko et al. (2024).

If stepwise = TRUE, the closed testing procedure is applied. In this case, no confidence intervals can be computed for the linear combinations but potentially more tests can reject.

Note that the calculations for the permutation test may take a while.

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 RMTLs, 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., Dobler, D., Ditzhaus, M. (2024). Multiple tests for restricted mean time lost with competing risks data, arXiv preprint (arXiv:2409.07917). doi:10.48550/arXiv.2409.07917

Examples

library(mstate)
data("ebmt2")

# multiple asymptotic tests
out <- RMTL.test(time = ebmt2$time,
                 status = ebmt2$status,
                 group = ebmt2$match,
                 hyp_mat = "Dunnett",
                 tau = 120,
                 method = "asymptotic")
summary(out)
plot(out)

## or, equivalently,
out <- RMTL.test(formula = "time ~ match",
                 event = "status",
                 data = ebmt2,
                 hyp_mat = "Dunnett",
                 tau = 120,
                 method = "asymptotic")
summary(out)
plot(out)


# multiple permutation tests
# this may take a few minutes
out_perm <- RMTL.test(formula = "time ~ match",
                      event = "status",
                      data = ebmt2,
                      hyp_mat = "Dunnett",
                      tau = 120,
                      method = "permutation",
                      Nres = 999)
summary(out_perm)
plot(out_perm)