Learn R Programming

RBesT (version 1.2-2)

oc1S: Operating Characteristics for 1 Sample Design

Description

Calculates the frequency at which the decision function is evaluated to 1 under a specified true scenario and decision criteria in a one-sample experiment.

Usage

oc1S(prior, n, decision, ...)

# S3 method for betaMix oc1S(prior, n, decision, ...)

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

# S3 method for gammaMix oc1S(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 oc1Sdecision.

...

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.

Value

Returns a function which when called with one argument theta will return the frequencies at which the decision function is evaluated to 1. If called with no argument, then the critical value \(y_c\) is returned. Note that the returned function takes vectors arguments.

Methods (by class)

  • betaMix: Applies for the beta-binomial model with a mixture beta prior. The calculations use exact expressions.

  • normMix: Used for the normal-normal model with fixed standard deviation (\(\sigma\)) of the sampling space and a normal mixture prior. As a consequence from the mean assumption, the calculation discards sampling uncertainty of the second moment. The function has an extra argument eps (defaults to \(10^{-6}\)). The critical value \(y_c\) is searched in the region of probability mass 1-eps for \(y\).

  • gammaMix: Used for the Poisson-gamma case (Poisson-exponential not yet supported). Takes an extra argument eps (\(10^6\)) which determines the region of probability mass 1-eps where the boundary is searched for \(y\).

Details

The operating characteristics calculate the frequency with which the decision function is evaluated to 1 under the assumption of a given true distribution of the data defined by \(\theta\). The specification of the prior, the sample size and the decision function, \(D(y)\), uniquely defines the decision boundary

$$y_c = \sup_y\{D(y) = 0\},$$

which is the critical value whenever the decision \(D(y)\) function changes its value from 0 to 1 for a decision function with lower.tail=TRUE (otherwise the definition is \(y_c = \inf_{y}\{D(y) = 1\}\)). 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 = \sum_{i=1}^{n} y_i\) and for the normal case as the mean \(\bar{y} = 1/n \sum_{i=1}^n y_i\).

Calling the oc1S function calculates the critical value \(y_c\) and returns a function which can be used to query the critical value or evaluate the desired frequency which is evaluated as

$$ F(y_c|\theta). $$

Note: Internally, the above integration is carried out assuming that it suffices to assume a true distribution of the mean.

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 \leq 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).

References

Neuenschwander B, Rouyrre N, Hollaender H, Zuber E, Branson M. A proof of concept phase II non-inferiority criterion. Stat. in Med.. 2011, 30:1618-1627

Examples

Run this code
# NOT RUN {
# see Neuenschwander et al., 2011

# example is for a time-to-event trial evaluationg non-inferiority
# using a normal approximation for the log-hazard ratio

# reference scale
s <- 2
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 )  # n for which design was intended
nL <- 233
c1 <- theta_ni - za * s / sqrt(n1)

# flat prior
prior <- mixnorm(c(1,0,100), sigma=s)

# standard NI design
decA <- oc1Sdecision(1 - alpha, theta_ni, lower.tail=TRUE)

# for double criterion with indecision point (mean estimate must be
# lower than this)
theta_c <- c1

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

theta_eval  <- c(theta_a, theta_c, theta_ni)

designA_n1  <- oc1S(prior, n1, decA)
designA_nL  <- oc1S(prior, nL, decA)

designC_n1  <- oc1S(prior, n1, decComb)
designC_nL  <- oc1S(prior, nL, decComb)
designC1_nL <- oc1S(prior, nL, dec1)
designC2_nL <- oc1S(prior, nL, dec2)

designA_n1(theta_eval)
designA_nL(theta_eval)
designC_n1(theta_eval)
designC_nL(theta_eval)

# note: the decision for the nL case is driven by the second
# criterion (for the mean) only as the critical value is lower
designC1_nL()
designC2_nL()
designC_nL()

# }

Run the code above in your browser using DataLab