Skip to contents

pMaxCombo() computes p-values for the MaxCombo test based on output from simtrial::tenFHcorr(). This is still in an experimental stage and is intended for use with the simtrial::simfix() trial simulation routine. However, it can also be used to analyze clinical trial data such as that provided in the ADaM ADTTE format.

Usage

pMaxCombo(Z, dummy_var, algorithm = GenzBretz(maxpts = 50000, abseps = 1e-05))

Arguments

Z

a dataset output from tenFHcorr(); see examples.

dummy_var

a dummy input that allows group_map() to be used to compute p-values for multiple simulations.

algorithm

This is passed directly to the algorithm argument in the mvtnorm::pmvnorm()

Value

A numeric p-value

Examples

library(tidyr)
library(tibble)
library(dplyr)

# example 1
x <- simfix(nsim = 1,
            timingType = 5,
            rg = tibble(rho = c(0, 0, 1),
                        gamma = c(0, 1, 1)))
head(x)
#>   Events       lnhr rho gamma         Z        V1        V2        V3
#> 1    371 -0.6118002   0     0 -5.858371 1.0000000 0.8529777 0.9338122
#> 2    371 -0.6118002   0     1 -4.692869 0.8529777 1.0000000 0.9302991
#> 3    371 -0.6118002   1     1 -5.389820 0.9338122 0.9302991 1.0000000
#>                             cut Duration Sim
#> 1 Max(min follow-up, event cut) 70.67284   1
#> 2 Max(min follow-up, event cut) 70.67284   1
#> 3 Max(min follow-up, event cut) 70.67284   1
pMaxCombo(x)
#> [1] 2.337142e-09

# example 2
# Only use cuts for events, events + min follow-up
xx <- simfix(nsim = 100,
             timingType = 5,
             rg = tibble(rho = c(0, 0, 1),
                         gamma = c(0, 1, 1)))
head(xx)
#>   Events       lnhr rho gamma         Z        V1        V2        V3
#> 1    363 -0.3195887   0     0 -3.038829 1.0000000 0.8520385 0.9333916
#> 2    363 -0.3195887   0     1 -2.848011 0.8520385 1.0000000 0.9179366
#> 3    363 -0.3195887   1     1 -2.866036 0.9333916 0.9179366 1.0000000
#> 4    365 -0.3657426   0     0 -3.477080 1.0000000 0.8563265 0.9352832
#> 5    365 -0.3657426   0     1 -3.982915 0.8563265 1.0000000 0.9330368
#> 6    365 -0.3657426   1     1 -4.126865 0.9352832 0.9330368 1.0000000
#>                             cut Duration Sim
#> 1 Max(min follow-up, event cut) 72.85552   1
#> 2 Max(min follow-up, event cut) 72.85552   1
#> 3 Max(min follow-up, event cut) 72.85552   1
#> 4 Max(min follow-up, event cut) 71.26511   2
#> 5 Max(min follow-up, event cut) 71.26511   2
#> 6 Max(min follow-up, event cut) 71.26511   2
# MaxCombo power estimate for cutoff at max of targeted events, minimum follow-up
p <- xx %>% group_by(Sim) %>% group_map(pMaxCombo) %>% unlist()
mean(p < .025)
#> [1] 0.97