permutation_CER2: Permutation Conditional Error Rate

Description Usage Arguments Details Value Author(s)

Description

Computes the conditional type I error rate of a pre-planned permutation test in a two-stage adaptive design. We condition on the observed first stage data and treatment assignment as well as the observed second stage data as well as the observations from the extension of the trial.

Usage

1
2
3
permutation_CER2(x1, g1, x2, x3, stat = sumdiff, permutations = 1000,
  subsamples = 1000, alpha = 0.025, g2 = rep(c(-1, 1), each =
  length(x2)/2), restricted = TRUE, ...)

Arguments

x1

vector of preplanned first stage observations

g1

vector of first stage treatment assignments

x2

vector of preplanned second stage observations

x3

vector of observations from the extended trial

stat

function computing the test statistic (see Details)

permutations

number of permutations (rerandomizations) used to compute unconditional and conditional permutation distributions

subsamples

number of (second stage) subsamples used for conditional error rate estimation

alpha

pre-fixed significance level

g2

template vector for second stage treatment assignments

restricted

should group sizes be treated fixed

...

additional options to stat

Details

Based on the first stage data and treatment assignments one may perform sample size reassassment - and possibly other trial modifications - as long as the (preplanned) second stage sample size is not reduced.

stat needs to be a function of the form function(x,g,...) returning a numeric of length one. Possible options are sumdiff, meandiff, zstat

For the moment, we assume that observations are randomized using random allocation blocked by stages, (i.e. we resample using sample (g1)). g2 does not have to be the actual second stage treatment assignments but just one possible example randomization, that fixes the treatment group sizes.

Value

numeric value of the conditional error rate

Author(s)

Florian Klinglmueller


floatofmath/adaperm documentation built on May 16, 2019, 1:18 p.m.