Learn R Programming

adaptTest (version 1.1)

tsT: Function to implement an adaptive two-stage test

Description

There are four key quantities for the specification of an adaptive two-stage test: the overall test level \(\alpha\), stopping bounds \(\alpha_1 <= \alpha_0\) and the local level \(\alpha_2\) of the test after the second stage. These quantities are interrelated through the overall level condition. The function tsT calculates any of these quantities based on the others.

Usage

tsT(typ, a = NA, a0 = NA, a1 = NA, a2 = NA)

Value

If three of the four quantities \(\alpha\), \(\alpha_0\), \(\alpha_1\) and \(\alpha_2\) are provided, tsT returns the fourth. If only \(\alpha\) and \(\alpha_0\) are provided, tsT returns \(\alpha_1\) under the condition \(\alpha_1 = \alpha_2\) (the so-called "Pocock-type").

If the choice of arguments is not allowed (e.g., \(\alpha_0 < \alpha_1\)) or when a test cannot be constructed with this choice of arguments (e.g., \(\alpha_0 = 1\) and \(\alpha < \alpha_2\)), tsT returns NA.

IMPORTANT: When the result is (theoretically) not unique, tsT returns the maximal \(\alpha_1\), maximal \(\alpha_2\) or minimal \(\alpha_0\).

In all cases, tsT returns the result for the test specified by typ.

Arguments

typ

type of test: "b" for Bauer and Koehne (1994), "l" for Lehmacher and Wassmer (1999), "v" for Vandemeulebroecke (2006) and "h" for the horizontal conditional error function

a

\(\alpha\), the overall test level

a0

\(\alpha_0\), the futility stopping bound

a1

\(\alpha_1\), the efficacy stopping bound and local level of the test after the first stage

a2

\(\alpha_2\), the local level of the test after the second stage

Author

Marc Vandemeulebroecke

Details

An adaptive two-stage test can be viewed as a family of decreasing functions \(f[c](p_1)\) in the unit square. Each of these functions is a conditional error function, specifying the type I error conditional on the p-value \(p_1\) of the first stage. For example, \(f[c](p_1) = \min(1, c/p_1)\) corresponds to Fisher's combination test (Bauer and Koehne, 1994). Based on this function family, the test can be put into practice by specifying the desired overall level \(\alpha\), stopping bounds \(\alpha_1 <= \alpha_0\) and a parameter \(\alpha_2\). After computing \(p_1\), the test stops with or without rejection of the null hypothesis if \(p_1 <= \alpha_1\) or \(p_1 > \alpha_0\), respectively. Otherwise, the null hypothesis is rejected if and only if \(p_2 <= f[c](p_1)\) holds for the p-value \(p_2\) of the second stage, where \(c\) is such that the local level of this latter test is \(\alpha_2\) (e.g., \(c = c(\alpha_2) = \exp(-\chi^2_{4,\alpha_2}/2)\) for Fisher's combination test).

The four parameters \(\alpha\), \(\alpha_0\), \(\alpha_1\) and \(\alpha_2\) are interdependent: they must satisfy the level condition $$\alpha_1 + \int_{\alpha_1}^{\alpha_0} cef_{\alpha_2}(p_1) d p_1 = \alpha,$$ where \(cef_{\alpha_2}\) is the conditional error function (of a specified family) with parameter \(\alpha_2\). For example, this conditon translates to $$\alpha = \alpha_1 + c(\alpha_2) * (\log(\alpha_0) - \log(\alpha_1))$$ for Fisher's combination test (assuming that \(c(\alpha_2) < \alpha_1\); Bauer and Koehne, 1994). The function tsT calculates any of the four parameters based on the remaining ones. Currently, this is implemented for the following four tests: Bauer and Koehne (1994), Lehmacher and Wassmer (1999), Vandemeulebroecke (2006), and the horizontal conditional error function.

References

Bauer, P., Koehne, K. (1994). Evaluation of experiments with adaptive interim analyses. Biometrics 50, 1029-1041.

Lehmacher, W., Wassmer, G. (1999). Adaptive sample size calculations in group sequential trials. Biometrics 55, 1286-1290.

Vandemeulebroecke, M. (2006). An investigation of two-stage tests. Statistica Sinica 16, 933-951.

Vandemeulebroecke, M. (2008). Group sequential and adaptive designs - a review of basic concepts and points of discussion. Biometrical Journal 50, 541-557.

See Also

adaptTest package description

Examples

Run this code
## Example from Bauer and Koehne (1994): full level after final stage, alpha0 = 0.5
alpha  <- 0.1
alpha2 <- 0.1
alpha0 <- 0.5
alpha1 <- tsT(typ="b", a=alpha, a0=alpha0, a2=alpha2)
plotCEF(typ="b", a2=alpha2, add=FALSE)
plotBounds(alpha1, alpha0)

## See how similar Lehmacher and Wassmer (1999) and Vandemeulebroecke (2006) are
alpha  <- 0.1
alpha1 <- 0.05
alpha0 <- 0.5
alpha2l <- tsT(typ="l", a=alpha, a0=alpha0, a1=alpha1)
alpha2v <- tsT(typ="v", a=alpha, a0=alpha0, a1=alpha1)
plotCEF(typ="l", a2=alpha2l, add=FALSE)
plotCEF(typ="v", a2=alpha2v, col="red")
plotBounds(alpha1, alpha0)

## A remark about numerics
tsT(typ="b", a=0.1, a1=0.05, a0=0.5)
tsT(typ="b", a=0.1, a2=0.104877, a0=0.5)
tsT(typ="b", a=0.1, a2=tsT(typ="b", a=0.1, a1=0.05, a0=0.5), a0=0.5)

## An example of non-uniqueness: the maximal alpha1 is returned; any
##  smaller value would also be valid
alpha  <- 0.05
alpha0 <- 1
alpha2 <- 0.05
alpha1 <- tsT(typ="b", a=alpha, a0=alpha0, a2=alpha2)
tsT(typ="b", a0=alpha0, a1=alpha1, a2=alpha2)
tsT(typ="b", a0=alpha0, a1=alpha1/2, a2=alpha2)

Run the code above in your browser using DataLab