TwoStageDesign is the fundamental design class of the
adoptr package.
Formally, we represent a generic two-stage design as a five-tuple
(n1, c1f, c1e, n2(·), c2(·)).
Here, n1 is the first-stage sample
size (per group), c1f
and c1e are
boundaries for early stopping for futility and efficacy, respectively.
Since the trial design is a two-stage design, the elements
n2(·) (stage-two sample
size) and c2(·)
(stage-two critical value) are functions of the first-stage outcome
X1=x1.
X1 denotes the first-stage test
statistic. A brief description on this definition of two-stage designs can be
read here.
For available methods, see the 'See Also' section at the end of this page.
Usage
TwoStageDesign(n1, ...)
# S4 method for class 'numeric'
TwoStageDesign(
n1,
c1f,
c1e,
n2_pivots,
c2_pivots,
order = NULL,
event_rate,
...
)
# S4 method for class 'TwoStageDesign'
summary(object, ..., rounded = TRUE)Arguments
- n1
stage-one sample size
- ...
further optional arguments
- c1f
early futility stopping boundary
- c1e
early efficacy stopping boundary
- n2_pivots
numeric vector, stage-two sample size on the integration pivot points
- c2_pivots
numeric vector, stage-two critical values on the integration pivot points
- order
integer, integration order of the employed Gaussian quadrature integration rule to evaluate scores. Automatically set tolength(n2_pivots)iflength(n2_pivots) == length(c2_pivots) > 1, otherwise c2 and n2 are taken to be constant in stage-two and replicated to match the number of pivots specified byorder- event_rate
probability that a subject in either group will eventually have an event, only needs to be specified for time-to-event endpoints
- object
object to show
- rounded
should rounded n-values be used?
Details
summary can be used to quickly compute and display basic facts about
a TwoStageDesign.
An arbitrary number of names UnconditionalScore objects can be
provided via the optional arguments ... and are included in the summary displayed using
print.
Slots
n1cf. parameter 'n1'
c1fcf. parameter 'c1f'
c1ecf. parameter 'c1e'
n2_pivotsvector of length 'order' giving the values of n2 at the pivot points of the numeric integration rule
c2_pivotsvector of length order giving the values of c2 at the pivot points of the numeric integration rule
x1_norm_pivotsnormalized pivots for integration rule (in [-1, 1]) the actual pivots are scaled to the interval [c1f, c1e] and can be obtained by the internal method
adoptr:::scaled_integration_pivots(design)weightsweights of of integration rule at
x1_norm_pivotsfor approximating integrals overx1tunablenamed logical vector indicating whether corresponding slot is considered a tunable parameter (i.e. whether it can be changed during optimization via
minimizeor not; cf.make_fixed)
See also
For accessing sample sizes and critical values safely, see methods in
n and c2; for modifying behaviour during optimizaton
see make_tunable; to convert between S4 class represenation and
numeric vector, see tunable_parameters; for simulating from a given
design, see simulate;
for plotting see plot,TwoStageDesign-method.
Both group-sequential and
one-stage designs (!) are implemented as subclasses of
TwoStageDesign.
Examples
design <- TwoStageDesign(50, 0, 2, 50.0, 2.0, 5)
pow <- Power(Normal(), PointMassPrior(.4, 1))
summary(design, "Power" = pow)
#> TwoStageDesign: n1 = 50
#>
futility | continue | efficacy
#>
x1: -0.00 | 0.09 0.46 1.00 1.54 1.91 | 2.00
#>
c2(x1): +Inf | +2.00 +2.00 +2.00 +2.00 +2.00 | -Inf
#>
n2(x1): 0 | 50 50 50 50 50 | 0
#>
Power: 0.739
#>
