Inadoptr scores are used to assess the performance of a design.This can be done either conditionally on the observed stage-one outcomeor unconditionally.Consequently, score objects are either of classConditionalScore orUnconditionalScore.
Usage
expected(s,data_distribution,prior,...)# S4 method for class 'ConditionalScore'expected(s,data_distribution,prior, label=NA_character_,...)evaluate(s,design,...)# S4 method for class 'IntegralScore,TwoStageDesign'evaluate(s,design, optimization=FALSE, subdivisions=10000L,...)Arguments
- s
Scoreobject- data_distribution
DataDistributionobject- prior
a
Priorobject- ...
further optional arguments
- label
object label (string)
- design
object
- optimization
logical, if
TRUEuses a relaxation to realparameters of the underlying design; used for smooth optimization.- subdivisions
maximal number of subdivisions when evaluating an integralscore using adaptive quadrature (optimization = FALSE)
Details
All scores can be evaluated on a design using theevaluate method.Note thatevaluate requires a third argumentx1 forconditional scores (observed stage-one outcome).AnyConditionalScore can be converted to aUnconditionalScoreby forming its expected value usingexpected.The returned unconditional score is of classIntegralScore.
Examples
design<-TwoStageDesign( n1=25, c1f=0, c1e=2.5, n2=50, c2=1.96, order=7L)prior<-PointMassPrior(.3,1)# conditionalcp<-ConditionalPower(Normal(),prior)expected(cp,Normal(),prior)#> E[Pr[x2>=c2(x1)|x1]]<Normal<two-armed>;PointMass<0.30>>evaluate(cp,design, x1=.5)#> [1] 0.3227581# unconditionalpower<-Power(Normal(),prior)evaluate(power,design)#> [1] 0.3269562evaluate(power,design, optimization=TRUE)# use non-adaptive quadrature#> [1] 0.3269562