ovP {adaptTest} | R Documentation |
Function to compute and visualize overall p-values
Description
This function computes and plots overall p-values for adaptive two-stage tests.
Usage
ovP(typ = NA, fun = NA, dis = NA, p1 = 1:49/50, p2 = p1,
a1 = 0, a0 = 1, grid = FALSE, plt = FALSE,
invisible = FALSE, wire = FALSE, round = FALSE)
Arguments
typ |
type of test: |
fun |
a conditional error function |
dis |
a distortion method for a supplied conditional error function (see details): |
p1 |
the p-value |
p2 |
the p-value |
a1 |
|
a0 |
|
grid |
logical determining whether a grid should be spanned by |
plt |
logical determining whether the overall p-values should be plotted or not (default: not) |
invisible |
logical determining whether the printing of the overall p-values should be suppressed or not (default: not) |
wire |
logical determining whether the overall p-values should be plotted in wireframe-style or in cloud-style (default: cloud-style) |
round |
rounding specification, logical or integer (see details; default: no rounding) |
Details
The overall p-value for an adaptive two-stage test is computed as p_1
if p_1 <= \alpha_1
or p_1 > \alpha_0
, and as
\alpha_1 + \int_{\alpha_1}^{\alpha_0} cef_{(p_1,p_2)}(x) d x
otherwise, where cef_{(p_1,p_2)}
is the conditional error function (of a specified family) running through the observed pair of p-values (p1,p2)
.
There are two alternative ways of specifying the family of conditional error functions (i.e., the test): through a type typ
, or through an initial conditional error function fun
and a distortion method dis
; see CEF
for details.
If p1 and p2 are of length 1, a single overall p-value is computed (and not plotted). Otherwise, the behavior of ovP
depends on grid
:
If
grid = FALSE
, overall p-values are computed (and not plotted) for the elementwise pairs ofp1
andp2
. Here,p1
andp2
must be of the same length.If
grid = TRUE
, a grid is spanned byp1
andp2
, and p-values are computed (and possibly plotted) over this grid. Here,p1
andp2
may be of different length. Plotting is triggered byplt = TRUE
, and the style of the plot (wireframe or cloud) is determined bywire
.invisible = TRUE
suppresses the printing of the p-values.
The p-values are rounded to round
digits after the comma (round = TRUE
rounds to 1 digit; round = FALSE
and round = 0
prevent rounding). The plot always shows unrounded values.
Value
A p-value, a vector of p-values or a matrix of p-values.
Note
Provide either typ
or fun
, not both! If fun
is provided, then also specify dis
.
Author(s)
Marc Vandemeulebroecke
References
Bauer, P., Koehne, K. (1994). Evaluation of experiments with adaptive interim analyses. Biometrics 50, 1029-1041.
Brannath, W., Posch, M., Bauer, P. (2002). Recursive combination tests. J. Amer. Statist. Assoc. 97, 236-244.
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, CEF
Examples
## Visualize a Lehmacher Wassmer (1999) test to the overall level 0.1
## and compute and visualize the overall p-value for an observed (p1,p2)=(0.3,0.7)
alpha <- .1
alpha0 <- .5
alpha1 <- .05
plotBounds(a1=alpha1, a0=alpha0, add=FALSE)
plotCEF(typ="l", a2=tsT(typ="l", a=alpha, a0=alpha0, a1=alpha1))
plotCEF(typ="l", p1=.3, p2=.7)
ovP(typ="l", p1=.3, p2=.7, a1=alpha1, a0=alpha0)
# The overall p-value is the area left of alpha1, plus the area below the
# conditional error function running though (0.3,0.7) between alpha1 and alpha0.
## Investigate the p-values of the Lehmacher Wassmer (1999) test from above
ovP(typ="l", a1=alpha1, a0=alpha0, grid=TRUE, p1=1:9/10, round=3)
ovP(typ="l", a1=alpha1, a0=alpha0, grid=TRUE, plt=TRUE, invisible=TRUE, wire=TRUE)