Learn R Programming

adaptTest (version 1.1)

CEF: Function to specify a conditional error function

Description

This function returns a conditional error function.

Usage

CEF(typ = NA, fun = NA, dis = NA, a2 = NA, c = NA, p1 = NA, p2 = p1)

Value

These functions return a conditional error function (see details).

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

c

the parameter \(c\)

a2

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

p1

the p-value \(p_1\) of the test after the first stage

p2

the p-value \(p_2\) of the test after the second stage, defaults to p1

fun

a conditional error function

dis

a distortion method for a supplied conditional error function (see details): "pl" for power lines, "vt" for vertical translation

Author

Marc Vandemeulebroecke

Details

There are two alternative ways of specifying the desired conditional error function:

  • through a type typ, and either a parameter (either a2 or c) or a point (p1,p2), OR

  • through an initial conditional error function fun, and possibly a distortion method dis together with either the parameter a2 or a point (p1,p2)

Most people will only need the first of these two ways; the second leads to user-defined non-standard tests.

If typ is specified, a parameter a2 or c or the point (p1,p2) must be provided. In this case, CEF returns the conditional error function of the chosen type with the given parameter or running through the given point.

If typ is not specified, a conditional error function (i.e., a nonincreasing function defined on [0,1] with values in [0,1]) fun must be provided. If no distortion method is selected (dis = NA), fun is returned unchanged. Otherwise, the function is distorted using the chosen distortion method, either to match a desired second stage level a2 or to run through a specified point (p1,p2) (one of which must be provided). Currently, two distortion methods are implemented:

  • dis = "pl", Power lines: For an initial function \(f\), define \(f[r](x) = (f(x^r))^(1/r)\), r>0. Note that if \(f\) is a conditional error function of type "b" (Bauer and Koehne, 1994), so is \(f[r]\).

  • dis = "pl", Vertical translation: The initial function is shifted vertically.

See parconv for more information on the two alternative parameterizations by \(\alpha_2\) and \(c\).

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.

See Also

adaptTest package description, parconv, plotCEF, tsT

Examples

Run this code
## Plot two conditional error functions of the Lehmacher-Wassmer (1999) type:
## one to the local level alpha2=0.1, and one that runs through (p1,p2)=(0.3,0.7)
foo1 <- CEF(typ="l", a2=0.1)
foo2 <- CEF(typ="l", p1=0.3, p2=0.7)
plot(foo1, xlim=0:1)
plot(foo2, add=TRUE)

## A different way of doing the same
plotCEF(typ="l", a2=0.1, add=FALSE)
plotCEF(typ="l", p1=0.3, p2=0.7, plt.pt=FALSE)

Run the code above in your browser using DataLab