pvalue_maxcombo: MaxCombo p-value

View source: R/pvalue_maxcombo.R

pvalue_maxcomboR Documentation

MaxCombo p-value

Description

pvalue_maxcombo() 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::sim_fixed_n() trial simulation routine. However, it can also be used to analyze clinical trial data such as that provided in the ADaM ADTTE format.

Usage

pvalue_maxcombo(
  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 <- sim_fixed_n(nsim = 1,
            timingType = 5,
            rg = tibble(rho = c(0, 0, 1),
                        gamma = c(0, 1, 1)))
head(x)
pvalue_maxcombo(x)

# example 2
# Only use cuts for events, events + min follow-up
xx <- sim_fixed_n(nsim = 100,
             timingType = 5,
             rg = tibble(rho = c(0, 0, 1),
                         gamma = c(0, 1, 1)))
head(xx)
# MaxCombo power estimate for cutoff at max of targeted events, minimum follow-up
p <- xx %>% group_by(Sim) %>% group_map(pvalue_maxcombo) %>% unlist()
mean(p < .025)


keaven/simtrial documentation built on April 17, 2023, 4:03 a.m.