Description Usage Arguments Details Value Methods (by class) See Also Examples
The oc1S
function defines a 1 sample design (prior, sample
size, decision function) for the calculation of the frequency at
which the decision is evaluated to 1 conditional on assuming
known parameters. A function is returned which performs the actual
operating characteristics calculations.
1 2 3 4 5 6 7 8 9 10 |
prior |
Prior for analysis. |
n |
Sample size for the experiment. |
decision |
One-sample decision function to use; see |
... |
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 |
The oc1S
function defines a 1 sample design and
returns a function which calculates its operating
characteristics. This is the frequency with which the decision
function is evaluated to 1 under the assumption of a given true
distribution of the data defined by a known parameter
θ. The 1 sample design is defined by the prior, the
sample size and the decision function, D(y). These uniquely
define the decision boundary, see
decision1S_boundary
.
When calling the oc1S
function, then internally the critical
value y_c (using decision1S_boundary
) is
calculated and a function is returns which can be used to
calculated the desired frequency which is evaluated as
F(y_c|θ).
Returns a function with one argument theta
which
calculates the frequency at which the decision function is
evaluated to 1 for the defined 1 sample design. Note that the
returned function takes vectors arguments.
betaMix
: Applies for binomial model with a mixture
beta prior. The calculations use exact expressions.
normMix
: Applies for the normal model with known
standard deviation σ and a normal mixture prior for the
mean. As a consequence from the assumption of a known standard
deviation, the calculation discards sampling uncertainty of the
second moment. The function oc1S
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
: Applies for the Poisson model with a gamma
mixture prior for the rate parameter. The function
oc1S
takes an extra argument eps
(defaults to 10^{-6})
which determines the region of probability mass 1-eps
where
the boundary is searched for y.
Other design1S:
decision1S_boundary()
,
decision1S()
,
pos1S()
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 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 | # 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)
# standard NI design
decA <- decision1S(1 - alpha, theta_ni, lower.tail=TRUE)
# 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)
theta_eval <- c(theta_a, theta_c, theta_ni)
# evaluate different designs at two sample sizes
designA_n1 <- oc1S(flat_prior, n1, decA)
designA_nL <- oc1S(flat_prior, nL, decA)
designC_n1 <- oc1S(flat_prior, n1, decComb)
designC_nL <- oc1S(flat_prior, nL, decComb)
# evaluate designs at the key log-HR of positive treatment (HR<1),
# the indecision point and the NI margin
designA_n1(theta_eval)
designA_nL(theta_eval)
designC_n1(theta_eval)
designC_nL(theta_eval)
# to understand further the dual criterion design it is useful to
# evaluate the criterions separatley:
# statistical significance criterion to warrant NI...
designC1_nL <- oc1S(flat_prior, nL, dec1)
# ... or the clinically determined indifference point
designC2_nL <- oc1S(flat_prior, nL, dec2)
designC1_nL(theta_eval)
designC2_nL(theta_eval)
# see also ?decision1S_boundary to see which of the two criterions
# will drive the decision
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.