decision1S_boundary: Decision Boundary for 1 Sample Designs

Description Usage Arguments Details Value Methods (by class) See Also Examples

View source: R/decision1S_boundary.R

Description

Calculates the decision boundary for a 1 sample design. This is the critical value at which the decision function will change from 0 (failure) to 1 (success).

Usage

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
decision1S_boundary(prior, n, decision, ...)

## S3 method for class 'betaMix'
decision1S_boundary(prior, n, decision, ...)

## S3 method for class 'normMix'
decision1S_boundary(prior, n, decision, sigma, eps = 1e-06, ...)

## S3 method for class 'gammaMix'
decision1S_boundary(prior, n, decision, eps = 1e-06, ...)

Arguments

prior

Prior for analysis.

n

Sample size for the experiment.

decision

One-sample decision function to use; see decision1S.

...

Optional arguments.

sigma

The fixed reference scale. If left unspecified, the default reference scale of the prior is assumed.

eps

Support of random variables are determined as the interval covering 1-eps probability mass. Defaults to 10^{-6}.

Details

The specification of the 1 sample design (prior, sample size and decision function, D(y)), uniquely defines the decision boundary

y_c = max_{y}{D(y) = 1},

which is the maximal value of y whenever the decision D(y) function changes its value from 1 to 0 for a decision function with lower.tail=TRUE (otherwise the definition is y_c = max_{y}{D(y) = 0}). The decision function may change at most at a single critical value as only one-sided decision functions are supported. Here, y is defined for binary and Poisson endpoints as the sufficient statistic y = ∑_{i=1}^{n} y_i and for the normal case as the mean \bar{y} = 1/n ∑_{i=1}^n y_i.

The convention for the critical value y_c depends on whether a left (lower.tail=TRUE) or right-sided decision function (lower.tail=FALSE) is used. For lower.tail=TRUE the critical value y_c is the largest value for which the decision is 1, D(y ≤q y_c) = 1, while for lower.tail=FALSE then D(y > y_c) = 1 holds. This is aligned with the cumulative density function definition within R (see for example pbinom).

Value

Returns the critical value y_c.

Methods (by class)

See Also

Other design1S: decision1S(), oc1S(), pos1S()

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
# non-inferiority example using normal approximation of log-hazard
# ratio, see ?decision1S for all details
s <- 2
flat_prior <- mixnorm(c(1,0,100), sigma=s)
nL <- 233
theta_ni <- 0.4
theta_a <- 0
alpha <- 0.05
beta  <- 0.2
za <- qnorm(1-alpha)
zb <- qnorm(1-beta)
n1 <- round( (s * (za + zb)/(theta_ni - theta_a))^2 )
theta_c <- theta_ni - za * s / sqrt(n1)

# double criterion design
# statistical significance (like NI design)
dec1 <- decision1S(1-alpha, theta_ni, lower.tail=TRUE)
# require mean to be at least as good as theta_c
dec2 <- decision1S(0.5, theta_c, lower.tail=TRUE)
# combination
decComb <- decision1S(c(1-alpha, 0.5), c(theta_ni, theta_c), lower.tail=TRUE)

# critical value of double criterion design
decision1S_boundary(flat_prior, nL, decComb)

# ... is limited by the statistical significance ...
decision1S_boundary(flat_prior, nL, dec1)

# ... or the indecision point (whatever is smaller)
decision1S_boundary(flat_prior, nL, dec2)

RBesT documentation built on Nov. 24, 2021, 5:07 p.m.