asymdesign: Boundary and sample size computation using asymptotic test.

Description Usage Arguments Details Value Reference See Also Examples

View source: R/asymdesign.R

Description

Calculate boundaries and sample sizes of single-arm group sequential design with binary endpoint based on asymptotic test.

Usage

1
2
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 X_{1}, X_{2}, … are binary outcomes following Bernoulli distribution b(1,p), in which 1 stands for the case that the subject responds to the treatment and 0 otherwise. Consider a group sequential test with K planned analyses, where the null and alternative hypotheses are H_0: p=p_0 and H_1: p=p_1 respectively. Note that generally p_1 is greater than p_0. For k<K, the trial stops if and only if the test statistic Z_k crosses the futility boundary, that is, Z_k<=l_k. The lower bound for the last analysis l_K is set to be equal to the last and only upper bound u_K to make a decision. At the last analysis, the null hypothesis will be rejected if Z_K>=u_K.

The computation of lower bounds except for the last one is implemented with u_K 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 n_{1}, n_{2}, …, n_{K}. For binomial endpoint, the Fisher information equals n_k/p/(1-p) which is proportional to n_k. Accordingly, the information fraction available at each analysis is equivalent to n_k/n_K.

For a p_0 not close to 1 or 0, with a large sample size, the test statistic at analysis k is Z_k=\hat{θ}_k√{n_k/p/(1-p)}=(∑_{s=1}^{n_k}X_s/n_k-p_0)√{n_k/p/(1-p)}, which follows the normal distribution N(θ √{n_k/p/(1-p)},1) with θ=p-p_0. In practice, p in Z_k can be substituted with the sample response rate ∑_{s=1}^{n_k}X_s/n_k.

Under the null hypothesis, θ=0 and Z_k follows a standard normal distribution. During the calculation, the only upper bound u_K is firstly derived under H_0, without given n_K. Thus, there is no need to adjust u_K for different levels of n_K. Following East, given u_K, compute the maximum sample size n_K under H_1. The rest sample sizes can be obtained by multiplying information fractions and n_K. The lower boundaries for the first K-1 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:

Reference

See Also

asymprob, asymcp, exactdesign.

Examples

1
2
3
4
5
6
7
8
9
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)

BinGSD documentation built on Oct. 30, 2019, 5:07 p.m.