composite {adoptr} | R Documentation |
composite
defines new composite scores by point-wise evaluation of
scores in any valid numerical expression.
composite(expr) ## 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 |
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
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})