Skip to contents

Returns an object of class cer_design. This can be used for clinical trials with potential adaptions that are controlled for using the conditional error method.

Usage

cer_design(
  correlation = matrix(),
  weights = double(),
  alpha = double(),
  test_m = matrix(),
  alpha_spending_f = function() {
 },
  t = double(),
  seq_bonf = TRUE,
  names = NULL
)

Arguments

correlation

Correlation matrix describing the structure of the correlations between the different hypotheses, use NA for uncorrelated

weights

List of weights, measuring how important each hypothesis is

alpha

Single number, measuring what total alpha should be spent on the FWER

test_m

Transition matrix describing the graph for the closed test procedure to test the hypotheses

alpha_spending_f

alpha spending function, taking parameters alpha (for overall spent alpha) and t (information fraction at interim test)

t

numeric between 0 and 1 specifing the planned time fraction for the interim test

seq_bonf

to automatically reject hypotheses at the second stage if the sum of their PCER is greater 1

names

optional names for the hypotheses

If no names are provided in the names argument, the names of the weights arguments are used. If that is also unweighted, the names H1, H2, etc. are used.

Value

An object of class cer_design

Examples

as <- function(x,t) 2-2*pnorm(qnorm(1-x/2)/sqrt(t))
design <- cer_design(
 correlation=rbind(H1=c(1, NA),
                   H2=c(NA, 1)),
 weights=c(2/3, 1/3),
 alpha=0.05,
 test_m=rbind(c(0, 1),
              c(1, 0)),
 alpha_spending_f=as,
 t=0.5)

design
#> A CER Design object, for testing 2 hypotheses at FWER 0.05.
#> 
#> ── No interim test has been performed yet. ─────────────────────────────────────
#> ── No adaptions have been performed yet ────────────────────────────────────────
#> ── No final test has been performed yet ────────────────────────────────────────