Description Usage Arguments Value See Also Examples
View source: R/CompositeScore.R
composite
defines new composite scores by point-wise evaluation of
scores in any valid numerical expression.
1 2 3 4 | composite(expr, label = NA_character_)
## S4 method for signature 'CompositeScore,TwoStageDesign'
evaluate(s, design, ...)
|
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 |
design |
object |
... |
further optional arguments |
an object of class CompositeConditionalScore
or
CompositeUnconditionalScore
depending on the class of the scores used
in expr
Scores
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 | 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})
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.