Learn R Programming

gsDesign (version 2.4-01)

nSurvival: 3.4: Time-to-event sample size calculation (Lachin-Foulkes)

Description

nSurvival() is used to calculate the sample size for a clinical trial with a time-to-event endpoint. The Lachin and Foulkes (1986) method is used.

Usage

nSurvival(lambda1=1/12, lambda2=1/24, Ts=24, Tr=12, eta = 0, ratio = 1,
      alpha = 0.025, beta = 0.10, sided = 1, approx = FALSE,
      type = c("rr", "rd"), entry = c("unif", "expo"), gamma = NA)
print.nSurvival(x,...)
nEvents(hr = .6, alpha = .025, beta = .1, ratio = 1, sided = 1, hr0 =  1, n = 0, tbl = FALSE)

Arguments

lambda1, lambda2
event hazard rate for placebo and treatment group respectively.
eta
equal dropout hazard rate for both groups.
ratio
randomization ratio between placebo and treatment group. Default is balanced design, i.e., randomization ratio is 1.
Ts
maximum study duration.
Tr
accrual (recruitment) duration.
alpha
type I error rate. Default is 0.05 since 2-sided testing is default.
beta
type II error rate. Default is 0.10 (90% power). Not needed for nEvents() if n is provided.
sided
one or two-sided test? Default is two-sided test.
approx
logical. If TRUE, the approximation sample size formula for risk difference is used.
type
type of sample size calculation: risk ratio (rr) or risk difference (rd).
entry
patient entry type: uniform entry ("unif") or exponential entry ("expo").
gamma
rate parameter for exponential entry. NA if entry type is "unif" (uniform). A non-zero value is supplied if entry type is "expo" (exponential).
x
An object of class "nSurvival" returned by nSurvival() (optional: used for output; "months" or "years" would be the 'usual' choices).
hr
Hazard ratio under the alternative hypothesis (>0).
hr0
Hazard ratio under the null hypothesis (>0, != hr).
n
Number of events may be input to compute power rather than sample size.
tbl
Indicator of whether or not scalar (vector) or tabular output is desired for nEvents().
...
Allows additional arguments for print.nSurvival().

Value

  • nSurvival produces a list with the following component returned:
  • typeAs input.
  • entryAs input.
  • nSample size required (computed).
  • nEventsNumber of events required (computed).
  • lambda1As input.
  • lambda2As input.
  • etaAs input.
  • ratioAs input.
  • gammaAs input.
  • alphaAs input.
  • betaAs input.
  • sidedAs input.
  • TsAs input.
  • TrAs input.
  • nEvents produces a scalar or vector of sample sizes (or powers) when tbl=FALSE or, when tbl=TRUE a matrix of values with the following columns:
  • hrAs input.
  • nIf n[1]=0 on input (default), output contains the number of events need to obtain the input Type I and II error. If n[1]>0 on input, the input value is returned.
  • alphaAs input.
  • betaIf n[1]=0 on input (default), beta is output as input. Otherwise, this is the computed Type II error based on the input n.
  • PowerOne minus the output beta. When tbl=FALSE, n[1]>0, this is the value or vector of values returned.
  • deltaStandardized effect size represented by input difference between null and alternative hypothesis hazard ratios.
  • ratioRatio of experimental to control sample size where 'experimental' is the same as the group with hazard represented in the numerator of the hazard ratio.
  • seEstimated standard error for the observed log(hazard ratio) with the given sample size.

Details

nSurvival() produces an object of class "nSurvival" with the number of subjects and events for a set of pre-specified trial parameters, such as accrual duration and follow-up period. The calculation is based on Lachin and Foulkes (1986) method and can be used for risk ratio or risk difference. The function also consider non-uniform (exponential) entry as well as uniform entry. If the logical approx is TRUE, the variance under alternative hypothesis is used to replace the variance under null hypothesis. For non-uniform entry, a non-zero value of gamma for exponential entry must be supplied. For positive gamma, the entry distribution is convex, whereas for negative gamma, the entry distribution is concave. nEvents() uses the Schoenfeld (1981) method to approximate the number of events n (given beta) or the power (given n). Arguments may be vectors or scalars, but any vectors must have the same length.

References

Lachin JM and Foulkes MA (1986), Evaluation of Sample Size and Power for Analyses of Survival with Allowance for Nonuniform Patient Entry, Losses to Follow-Up, Noncompliance, and Stratification. Biometrics, 42, 507-519. Schoenfeld D (1981), The Asymptotic Properties of Nonparametric Tests for Comparing Survival Distributions. Biometrika, 68, 316-319.

See Also

gsDesign package overview, Plots for group sequential designs, gsDesign

Examples

Run this code
# consider a trial with 
# 2 year maximum follow-up
# 6 month uniform enrollment
# Treatment/placebo hazards = 0.1/0.2 per 1 person-year
# drop out hazard 0.1 per 1 person-year
# alpha = 0.025 (1-sided)
# power = 0.9 (default beta=.1)

ss <- nSurvival(lambda1=.2 , lambda2=.1, eta = .1, Ts = 2, Tr = .5,
                sided=1, alpha=.025)
ss

#  symmetric, 2-sided design with O'Brien-Fleming-like boundaries
#  sample size is computed based on a fixed design requiring n=100
	x<-gsDesign(k = 5, test.type = 2, n.fix=ss$nEvents, nFixSurv=ss$n)
# boundary plot
	plot(x)
# effect size plot
	plot(x, plottype = "hr")
# total sample size
   x$nSurv
# number of events at analyses
   x$n.I
# print the design
x

# approximate number of events required using Schoenfeld's method
# for 2 different hazard ratios
nEvents(hr=c(.5, .6), tbl=TRUE)
# vector output
nEvents(hr=c(.5, .6))

# approximate power using Schoenfeld's method
# given 2 sample sizes and hr=.6
nEvents(hr=.6, n=c(50, 100), tbl=TRUE)
# vector output
nEvents(hr=.6, n=c(50, 100))

Run the code above in your browser using DataLab