asymdesign {BinGSD} | R Documentation |
Boundary and sample size computation using asymptotic test.
Description
Calculate boundaries and sample sizes of single-arm group sequential design with binary endpoint based on asymptotic test.
Usage
asymdesign(I, beta = 0.3, betaspend, alpha = 0.05, p_0, p_1, K,
tol = 1e-06)
Arguments
I |
The information fractions at each analysis. For binary endpoints, the information fraction for analysis k is equal to n_k/n_K, where n_k is the sample size available at analysis k and n_K is the sample size available at the last analysis or the maximum sample size. Should be a positive increasing vector of length K or K-1. If I has K elements among which the last one is not 1, then I will be standardized so that the last information fraction is 1. If I has K-1 elements, the last element in I must be less than 1. |
beta |
The desired overall type II error level. Should be a scalar within the interval (0,0.5]. Default value is 0.3, that is, power=0.7. |
betaspend |
The proportions of beta spent at each analysis. Should be a vector of length K with all elements belong to [0,1]. If the sum of all elements in betaspend is not equal to 1, betaspend will be standardized. |
alpha |
The desired overall type I error level. Should be a scalar within the interval (0,0.3]. Default is 0.05. |
p_0 |
The response rate or the probability of success under null hypothesis. Should be a scalar within (0,1). |
p_1 |
The response rate or the probability of success under alternative hypothesis. Should be a scalar within (p_0,1). |
K |
The maximum number of analyses, including the interim and the final. Should be an integer within (1,20]. K will be rounded to its nearest whole number if it is not an integer. |
tol |
The tolerance level which is essentially the maximum acceptable difference between the desired type II error spending and the actual type II error spending, when computing the boundaries using asymptotic test. Should be a positive scalar no more than 0.01. The default value is 1e-6. |
Details
Suppose are binary outcomes following Bernoulli
distribution
, in which 1 stands for the case that the subject
responds to the treatment and 0 otherwise. Consider a group sequential test
with
planned analyses, where the null and alternative hypotheses are
and
respectively. Note that generally
is greater than
. For
, the trial stops if and
only if the test statistic
crosses the futility boundary, that is,
. The lower bound for the last analysis
is set to be
equal to the last and only upper bound
to make a decision. At the
last analysis, the null hypothesis will be rejected if
.
The computation of lower bounds except for the last one is implemented with
fixed, thus the derived lower bounds are non-binding. Furthermore,
the overall type I error will not be inflated if the trial continues after
crossing any of the interim lower bounds, which is convenient for the purpose
of monitoring. Let the sequence of sample sizes required at each analysis be
. For binomial endpoint, the Fisher
information equals
which is proportional to
.
Accordingly, the information fraction available at each analysis is equivalent
to
.
For a not close to 1 or 0, with a large sample size, the test
statistic at analysis
is
,
which follows the normal distribution
with
. In practice,
in
can be substituted
with the sample response rate
.
Under the null hypothesis, and
follows a standard
normal distribution. During the calculation, the only upper bound
is
firstly derived under
, without given
. Thus, there is no
need to adjust
for different levels of
. Following East,
given
, compute the maximum sample size
under
.
The rest sample sizes can be obtained by multiplying information fractions
and
. The lower boundaries for the first
analyses are
sequentially determined by a search method. The whole searching procedure
stops if the overall type II error does not excess the desired level or the
times of iteration excess 30. Otherwise, increase the sample sizes until
the type II error meets user's requirement.
The multiple integrals of multivariate normal density functions are conducted with
pmvnorm
in R package mvtnorm. Through a few transformations of the integral variables,
pmvnorm
turns the multiple integral to the product of several
univariate integrals, which greatly reduces the computational burden of sequentially searching for
appropriate boundaries.
Value
An object of the class asymdesign. This class contains:
I: I used in computation.
beta: As input.
betaspend: The desired type II error spent at each analysis used in computation.
alpha: As input.
p_0: As input.
p_1: As input.
K: K used in computation.
tol: As input.
n.I: A vector of length K which contains sample sizes required at each analysis to achieve desired type I and type II error requirements. n.I equals sample size for the last analysis times the vector of information fractions.
u_K: The upper boundary for the last analysis.
lowerbounds: A vector of length K which contains lower boundaries for each analysis. Note that the lower boundaries are non-binding.
problow: Probabilities of crossing the lower bounds under
or the actual type II error at each analysis.
probhi: Probability of crossing the last upper bound under
or the actual type I error.
power: power of the group sequential test with the value equals 1-sum(problow).
Reference
Cytel Inc. East Version 6.4.1 Manual. 2017.
Alan Genz et al. (2018). mvtnorm: Multivariate Normal and t Distributions. R package version 1.0-11.
See Also
asymprob
, asymcp
,
exactdesign
.
Examples
I=c(0.2,0.4,0.6,0.8,0.99)
beta=0.2
betaspend=c(0.1,0.2,0.3,0.3,0.2)
alpha=0.05
p_0=0.3
p_1=0.5
K=4.6
tol=1e-6
tt1=asymdesign(I,beta,betaspend,alpha,p_0,p_1,K,tol)