Scores: Scores

Description Usage Arguments Details See Also Examples

Description

In adoptr scores are used to assess the performance of a design. This can be done either conditionally on the observed stage-one outcome or unconditionally. Consequently, score objects are either of class ConditionalScore or UnconditionalScore.

Usage

1
2
3
4
5
6
7
8
9
expected(s, data_distribution, prior, ...)

## S4 method for signature 'ConditionalScore'
expected(s, data_distribution, prior, label = NA_character_, ...)

evaluate(s, design, ...)

## S4 method for signature 'IntegralScore,TwoStageDesign'
evaluate(s, design, optimization = FALSE, subdivisions = 10000L, ...)

Arguments

s

Score object

data_distribution

DataDistribution object

prior

a Prior object

...

further optional arguments

label

object label (string)

design

object

optimization

logical, if TRUE uses a relaxation to real parameters of the underlying design; used for smooth optimization.

subdivisions

maximal number of subdivisions when evaluating an integral score using adaptive quadrature (optimization = FALSE)

Details

All scores can be evaluated on a design using the evaluate method. Note that evaluate requires a third argument x1 for conditional scores (observed stage-one outcome). Any ConditionalScore can be converted to a UnconditionalScore by forming its expected value using expected. The returned unconditional score is of class IntegralScore.

See Also

ConditionalPower, ConditionalSampleSize, composite

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
design <- TwoStageDesign(
  n1    = 25,
  c1f   = 0,
  c1e   = 2.5,
  n2    = 50,
  c2    = 1.96,
  order = 7L
)
prior <- PointMassPrior(.3, 1)

# conditional
cp <- ConditionalPower(Normal(), prior)
expected(cp, Normal(), prior)
evaluate(cp, design, x1 = .5)

# unconditional
power <- Power(Normal(), prior)
evaluate(power, design)
evaluate(power, design, optimization = TRUE) # use non-adaptive quadrature

adoptr documentation built on June 28, 2021, 5:11 p.m.