composite {adoptr}R Documentation

Score Composition

Description

composite defines new composite scores by point-wise evaluation of scores in any valid numerical expression.

Usage

composite(expr, label = NA_character_)

## S4 method for signature 'CompositeScore,TwoStageDesign'
evaluate(s, design, ...)

Arguments

expr

Expression (in curly brackets); must contain at least one score variable; if multiple scores are used, they must either all be conditional or unconditional. Currently, no non-score variables are supported

label

object label (string)

s

object of class CompositeScore

design

object

...

further optional arguments

Value

an object of class CompositeConditionalScore or CompositeUnconditionalScore depending on the class of the scores used in expr

See Also

Scores

Examples

ess   <- ExpectedSampleSize(Normal(), PointMassPrior(.4, 1))
power <- Power(Normal(), PointMassPrior(.4, 1))

# linear combination:
composite({ess - 50*power})

# control flow (e.g. for and while loops)
composite({
  res <- 0
  for (i in 1:3) {
     res <- res + ess
  }
  res
})

# functional composition
composite({log(ess)})
cp <- ConditionalPower(Normal(), PointMassPrior(.4, 1))
composite({3*cp})


[Package adoptr version 1.0.1 Index]