Calculate Power in a Group Sequential Design
Description
Derives power in a two arm clinical trial under a group sequential design. Allows for arbitrary number of interim analyses, arbitrary specification of arm0/arm1 time to event distributions (via survival or hazard), arm0/arm1 censoring distribution, provisions for two types of continuous time noncompliance according to arm0/arm1 rate followed by switch to new hazard rate. Allows for analyses using (I) weighted logrank statistic, with weighting function (a) a member of the FlemmingHarrington GRho class, or (b) a stopped version thereof, or (c) the rampplateau deterministic weights, or (II) the integrated survival distance (currently under method=="S" without futility only). Stopping boundaries are computed via the LanDemets method, Haybittle method, or converted from the stochastic curtailment procedure. The LanDemets boundaries can be constructed usign either O'BrienFlemming, Pocock or WangTsiatis power alphaspending. The C kernel is readily extensible, and further options will become available in the near future.
Usage
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17  PwrGSD(EfficacyBoundary = LanDemets(alpha = 0.05, spending = ObrienFleming),
FutilityBoundary = LanDemets(alpha = 0.1, spending = ObrienFleming),
NonBindingFutility = TRUE, sided = c("2>", "2<", "1>", "1<"),
method = c("S", "A"), accru, accrat, tlook,
tcut0 = NULL, h0 = NULL, s0 = NULL, tcut1 = NULL,
rhaz = NULL, h1 = NULL, s1 = NULL, tcutc0 = NULL, hc0 = NULL,
sc0 = NULL, tcutc1 = NULL, hc1 = NULL, sc1 = NULL, tcutd0A = NULL,
hd0A = NULL, sd0A = NULL, tcutd0B = NULL, hd0B = NULL, sd0B = NULL,
tcutd1A = NULL, hd1A = NULL, sd1A = NULL, tcutd1B = NULL,
hd1B = NULL, sd1B = NULL, tcutx0A = NULL, hx0A = NULL, sx0A = NULL,
tcutx0B = NULL, hx0B = NULL, sx0B = NULL, tcutx1A = NULL,
hx1A = NULL, sx1A = NULL, tcutx1B = NULL, hx1B = NULL, sx1B = NULL,
noncompliance = c("none", "crossover", "mixed", "user"),
gradual = FALSE, WtFun = c("FH", "SFH", "Ramp"), ppar = cbind(c(0, 0)),
Spend.Info = c("Variance", "Events", "Hybrid(k)", "Calendar"), RR.Futility = NULL,
qProp.one.or.Q = c("one", "Q"), Nsim = NULL, detail = FALSE, StatType = c("WLR",
"ISD"))

Arguments
EfficacyBoundary 
This specifies the method used to construct the efficacy boundary. The available choices are: (i) (ii) (iii) (iv) User supplied boundary points in the form 
FutilityBoundary 
This specifies the method used to construct the futility boundary. The available choices are: (i) (ii) (iii) (iv) User supplied boundary points in the form 
NonBindingFutility 
When using a futility boundary and this is set to 'TRUE', the efficacy boundary will be constructed in the absence of the futility boundary, and then the futility boundary will be constructed given the resulting efficacy boundary. This results in a more conservative efficacy boundary with true type I error less than the nominal level. This is recommended due to the fact that futility crossings are viewed by DSMB's with much less gravity than an efficacy crossing and as such, the consensus is that efficacy bounds should not be discounted towards the null hypothesis because of paths which cross a futility boundary. Default value is 'TRUE'. 
sided 
Set to “2>” (quoted) for two sided tests of the null hypothesis when a positive drift corresponds to
efficacy. Set to “2<” (quoted) for two sided tests of the null hypothesis when a negative drift corresponds to
efficacy. Set to “1>” or “1<” for one sided tests of H0 when efficacy corresponds to a positive or negative drift,
respectively. If 
method 
Determines how to calculate the power. Set to “A” (Asymptotic method, the default) or “S” (Simulation method) 
accru 
The upper endpoint of the accrual period beginning with time 0. 
accrat 
The rate of accrual per unit of time. 
tlook 
The times of planned interim analyses. 
tcut0 
Left hand endpoints for intervals upon which the arm0 specific mortality is constant. The last given component is the left hand endpoint of the interval having right hand endpoint infinity. 
h0 
A vector of the same length as 
s0 
Alternatively, the arm0 mortality distribution can be supplied via this argument, in terms of of the corresponding
survival function values at the times given in the vector 
tcut1 
Left hand endpoints for intervals upon which the arm1 specific mortality is constant. The last given component is the left hand endpoint of the interval having right hand endpoint infinity. 
rhaz 
A vector of piecewise constant arm1 versus arm0 mortality rate ratios. If 
h1 
Alternatively, the arm1 mortality distribution can be supplied via this argument by specifying the piecewise constant arm1 mortality rate. See the comments above. 
s1 
Alternatively, the arm1 mortality distribution can be supplied via this argument, in terms of of the corresponding
survival function values at the times given in the vector 
tcutc0 
Left hand endpoints for intervals upon which the arm0 specific censoring distribution hazard function is constant. The last given component is the left hand endpoint of the interval having right hand endpoint infinity. 
hc0 
A vector of the same length as 
sc0 
Alternatively, the arm0 censoring distribution can be supplied via this argument, in terms of of the corresponding
survival function values at the times given in the vector 
tcutc1 
Left hand endpoints for intervals upon which the arm1 specific censoring distribution hazard function is constant. The last given component is the left hand endpoint of the interval having right hand endpoint infinity. 
hc1 
A vector of the same length as 
sc1 
Alternatively, the arm1 censoring distribution can be supplied via this argument, in terms of of the
corresponding survival function values at the times given in the vector 
noncompliance 
(i) Seting 
tcutd0A 
Left hand endpoints for intervals upon which the arm0 specific causeA delay distribution hazard
function is constant. The last given component is the left hand endpoint of the interval having right hand endpoint
infinity. Required only when 
hd0A 
A vector of the same length as 
sd0A 
When required, the arm0 causeAdelay distribution is alternately specified via a survival function. A
vector of the same length as 
tcutd0B 
Left hand endpoints for intervals upon which the arm0 specific causeB delay distribution hazard
function is constant. The last given component is the left hand endpoint of the interval having right hand endpoint
infinity. Always required when 
hd0B 
A vector of the same length as 
sd0B 
When required, the arm0 causeBdelay distribution is alternately specified via a
survival function. A vector of the same length as 
tcutd1A 
Left hand endpoints for intervals upon which the arm1 specific causeA delay distribution hazard
function is constant. The last given component is the left hand endpoint of the interval having right hand endpoint
infinity. Required only when 
hd1A 
A vector of the same length as 
sd1A 
When required, the arm1 causeAdelay distribution is alternately specified via a survival function. A
vector of the same length as 
tcutd1B 
Left hand endpoints for intervals upon which the arm1 specific causeB delay distribution hazard
function is constant. The last given component is the left hand endpoint of the interval having right hand endpoint
infinity. Always required when 
hd1B 
A vector of the same length as 
sd1B 
When required, the arm1 causeAdelay distribution is alternately specified via a survival function. A
vector of the same length as 
tcutx0A 
Left hand endpoints for intervals upon which the arm0 specific postcauseAdelaymortality rate is
constant. The last given component is the left hand endpoint of the interval having right hand endpoint infinity. Required
only when 
hx0A 
A vector of the same length as 
sx0A 
When required, the arm0 postcauseAdelay mortality distribution is alternately specified via a
survival function. A vector of the same length as 
tcutx0B 
Left hand endpoints for intervals upon which the arm0 specific postcauseBdelaymortality rate is
constant. The last given component is the left hand endpoint of the interval having right hand endpoint infinity. Always
required when 
hx0B 
A vector of the same length as 
sx0B 
When required, the arm0 postcauseBdelay mortality distribution is alternately specified via a
survival function. A vector of the same length as 
tcutx1A 
Left hand endpoints for intervals upon which the arm1 specific postcauseAdelaymortality rate is
constant. The last given component is the left hand endpoint of the interval having right hand endpoint infinity. Required
only when 
hx1A 
A vector of the same length as 
sx1A 
When required, the arm1 postcauseAdelay mortality distribution is alternately specified via a
survival function. A vector of the same length as 
tcutx1B 
Left hand endpoints for intervals upon which the arm1 specific postcauseBdelaymortality rate is
constant. The last given component is the left hand endpoint of the interval having right hand endpoint infinity. Always
required when 
hx1B 
A vector of the same length as 
sx1B 
When required, the arm1 postcauseBdelay mortality distribution is alternately specified via a
survival function. A vector of the same length as 
gradual 
Should the conversion to postnoncompliance mortality be gradual. Under the default behavior,

WtFun 
Specifies the name of a weighting function (of time) for assigning relative weights to events according to the
times at which they occur. The default, “FH”, a two parameter weight function, specifies the
‘FlemingHarrington’ 
ppar 
A vector containing all the weight function parameters, in the order determined by that of “WtFun”. For
example, if 
RR.Futility 
The relative risk corresponding to the alternative alternative hypothesis that is required in the
construction of the futility boundary. Required if 
Spend.Info 
When the test statistic is something other than the unweighted logrank statistic, the variance
information, i.e. the ratio of variance at interim analysis to variance at the end of trial, is something other than the
ratio of events at interim analysis to the events at trial end. The problem is that in practice one doesn't necessarily
have a good idea what the end of trial variance should be. In this case the user may wish to spend the type I and type II
error probabilities according to a different time scale. Possible choices are “Variance”, (default), which just uses
the variance ratio scale, “Events”, which uses the events ratio scale, “Hybrid(k)”, which makes a linear
transition from the “Variance” scale to the “Events” scale beginning with analysis number 
qProp.one.or.Q 
If a futility boundary is specified, what assumption should be made about the drift function (the mean
value of the weighted logrank statistic at analysis 
Nsim 
If you specify 
detail 
If you specify 
StatType 
If you specify 
Value
Returns a value of class PwrGSD
which has components listed below. Note that the print method will display a
summary table of estimated powers and type I errors as a nstat
by 2 matrix. The summary method returns the same
object invisibly, but after computing the summary table mentioned above, and it is included in the returned value as a
commponent TBL
. See examples below.
dPower 
A 
dErrorI 
A 
detail 
A list with components equal to the arguments of the Ccall, which correspond in a natural way to the
arguments specified in the R call, along with the computed results in 
call 
the call 
Author(s)
Grant Izmirlian izmirlian@nih.gov
References
Gu, M.G. and Lai, T.L. “Determination of power and sample size in the design of clinical trials with failuretime endpoints and interim analyses.” Controlled Clinical Trials 20 (5): 423438. 1999
Izmirlian, G. “The PwrGSD package.” NCI Div. of Cancer Prevention Technical Report. 2004
Jennison, C. and Turnbull, B.W. (1999) Group Sequential Methods: Applications to Clinical Trials Chapman & Hall/Crc, Boca Raton FL
Proschan, M.A., Lan, K.K.G., Wittes, J.T. (2006), corr 2nd printing (2008) Statistical Monitoring of Clinical Trials A Unified Approach Springer Verlag, New York
See Also
cpd.PwrGSD
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  library(PwrGSD)
test.example <
PwrGSD(EfficacyBoundary = LanDemets(alpha = 0.05, spending = ObrienFleming),
FutilityBoundary = LanDemets(alpha = 0.1, spending = ObrienFleming),
RR.Futility = 0.82, sided="1<",method="A",accru =7.73, accrat =9818.65,
tlook =c(7.14, 8.14, 9.14, 10.14, 10.64, 11.15, 12.14, 13.14,
14.14, 15.14, 16.14, 17.14, 18.14, 19.14, 20.14),
tcut0 =0:19, h0 =c(rep(3.73e04, 2), rep(7.45e04, 3),
rep(1.49e03, 15)),
tcut1 =0:19, rhaz =c(1, 0.9125, 0.8688, 0.7814, 0.6941,
0.6943, 0.6072, 0.5202, 0.4332, 0.6520,
0.6524, 0.6527, 0.6530, 0.6534, 0.6537,
0.6541, 0.6544, 0.6547, 0.6551, 0.6554),
tcutc0 =0:19, hc0 =c(rep(1.05e02, 2), rep(2.09e02, 3),
rep(4.19e02, 15)),
tcutc1 =0:19, hc1 =c(rep(1.05e02, 2), rep(2.09e02, 3),
rep(4.19e02, 15)),
tcutd0B =c(0, 13), hd0B =c(0.04777, 0),
tcutd1B =0:6, hd1B =c(0.1109, 0.1381, 0.1485, 0.1637, 0.2446,
0.2497, 0),
noncompliance =crossover, gradual =TRUE,
WtFun =c("FH", "SFH", "Ramp"),
ppar =c(0, 1, 0, 1, 10, 10))
