Running examples in ‘gsDesign-Ex.R’ failed
The error most likely occurred in:

> base::assign(".ptime", proc.time(), pos = "CheckExEnv")
> ### Name: gsBoundSummary
> ### Title: 2.8: Bound Summary and Z-transformations
> ### Aliases: gsBoundSummary print.gsDesign summary.gsDesign
> ###   print.gsBoundSummary xprint gsBValue gsDelta gsHR gsRR gsCPz
> ###   'gsDesign print, summary and table summary functions'
> ### Keywords: design
> 
> ### ** Examples
> 
> # survival endpoint using gsSurv
> # generally preferred over nSurv since time computations are shown
> xgs <- gsSurv(lambdaC=.2, hr=.5, eta=.1, T=2, minfup=1.5)
Warning in -(lam + et) * s :
  Recycling array of length 1 in array-vector arithmetic is deprecated.
  Use c() or as.vector() instead.

Warning in lam/(lam + et) * Qm1 :
  Recycling array of length 1 in array-vector arithmetic is deprecated.
  Use c() or as.vector() instead.

Warning in (1 - q)/(lam + et) :
  Recycling array of length 1 in vector-array arithmetic is deprecated.
  Use c() or as.vector() instead.

Warning in gam/(lam + et) * lam * (s - (1 - q)/(lam + et)) :
  Recycling array of length 1 in array-vector arithmetic is deprecated.
  Use c() or as.vector() instead.

Warning in c(0, P[indx]) * gam :
  Recycling array of length 1 in vector-array arithmetic is deprecated.
  Use c() or as.vector() instead.

Warning in gam * s :
  Recycling array of length 1 in array-vector arithmetic is deprecated.
  Use c() or as.vector() instead.

Warning in -(lam + et) * s :
  Recycling array of length 1 in array-vector arithmetic is deprecated.
  Use c() or as.vector() instead.

Warning in lam/(lam + et) * Qm1 :
  Recycling array of length 1 in array-vector arithmetic is deprecated.
  Use c() or as.vector() instead.

Warning in (1 - q)/(lam + et) :
  Recycling array of length 1 in vector-array arithmetic is deprecated.
  Use c() or as.vector() instead.

Warning in gam/(lam + et) * lam * (s - (1 - q)/(lam + et)) :
  Recycling array of length 1 in array-vector arithmetic is deprecated.
  Use c() or as.vector() instead.

Warning in c(0, P[indx]) * gam :
  Recycling array of length 1 in vector-array arithmetic is deprecated.
  Use c() or as.vector() instead.

Warning in gam * s :
  Recycling array of length 1 in array-vector arithmetic is deprecated.
  Use c() or as.vector() instead.

Warning in -(lam + et) * s :
  Recycling array of length 1 in array-vector arithmetic is deprecated.
  Use c() or as.vector() instead.

Warning in lam/(lam + et) * Qm1 :
  Recycling array of length 1 in array-vector arithmetic is deprecated.
  Use c() or as.vector() instead.

Warning in (1 - q)/(lam + et) :
  Recycling array of length 1 in vector-array arithmetic is deprecated.
  Use c() or as.vector() instead.

Warning in gam/(lam + et) * lam * (s - (1 - q)/(lam + et)) :
  Recycling array of length 1 in array-vector arithmetic is deprecated.
  Use c() or as.vector() instead.

Warning in c(0, P[indx]) * gam :
  Recycling array of length 1 in vector-array arithmetic is deprecated.
  Use c() or as.vector() instead.

Warning in gam * s :
  Recycling array of length 1 in array-vector arithmetic is deprecated.
  Use c() or as.vector() instead.

Warning in -(lam + et) * s :
  Recycling array of length 1 in array-vector arithmetic is deprecated.
  Use c() or as.vector() instead.

Warning in lam/(lam + et) * Qm1 :
  Recycling array of length 1 in array-vector arithmetic is deprecated.
  Use c() or as.vector() instead.

Warning in (1 - q)/(lam + et) :
  Recycling array of length 1 in vector-array arithmetic is deprecated.
  Use c() or as.vector() instead.

Warning in gam/(lam + et) * lam * (s - (1 - q)/(lam + et)) :
  Recycling array of length 1 in array-vector arithmetic is deprecated.
  Use c() or as.vector() instead.

Warning in c(0, P[indx]) * gam :
  Recycling array of length 1 in vector-array arithmetic is deprecated.
  Use c() or as.vector() instead.

Warning in gam * s :
  Recycling array of length 1 in array-vector arithmetic is deprecated.
  Use c() or as.vector() instead.

> gsBoundSummary(xgs,timename="Year",tdigits=1)
   Analysis              Value Efficacy Futility
  IA 1: 33%                  Z   3.0107  -0.2388
     N: 460        p (1-sided)   0.0013   0.5944
 Events: 33        HR at bound   0.3457   1.0879
  Year: 0.8   P(Cross) if HR=1   0.0013   0.4056
            P(Cross) if HR=0.5   0.1412   0.0148
  IA 2: 67%                  Z   2.5465   0.9410
     N: 460        p (1-sided)   0.0054   0.1733
 Events: 65        HR at bound   0.5298   0.7907
  Year: 1.3   P(Cross) if HR=1   0.0062   0.8347
            P(Cross) if HR=0.5   0.5815   0.0437
      Final                  Z   1.9992   1.9992
     N: 460        p (1-sided)   0.0228   0.0228
 Events: 97        HR at bound   0.6655   0.6655
    Year: 2   P(Cross) if HR=1   0.0233   0.9767
            P(Cross) if HR=0.5   0.9000   0.1000
> summary(xgs)
[1] "Asymmetric two-sided group sequential design with non-binding futility bound, 3 analyses, time-to-event outcome with sample size 460 and 97 events required, 90 percent power, 2.5 percent (1-sided) Type I error to detect a hazard ratio of 0.5. Enrollment and total study durations are assumed to be 0.5 and 2 months, respectively. Efficacy bounds derived using a Hwang-Shih-DeCani spending function with gamma = -4. Futility bounds derived using a Hwang-Shih-DeCani spending function with gamma = -2."
> 
> # survival endpoint using nSurvival
> # NOTE: generally recommend gsSurv above for this!
> ss <- nSurvival(lambda1=.2 , lambda2=.1, eta = .1, Ts = 2, Tr = .5,
+                 sided=1, alpha=.025, ratio=2)
> xs <- gsDesign(nFixSurv=ss$n,n.fix=ss$nEvents, delta1=log(ss$lambda2/ss$lambda1))
> gsBoundSummary(xs,logdelta=TRUE, ratio=ss$ratio)
  Analysis              Value Efficacy Futility
 IA 1: 33%                  Z   3.0107  -0.2387
     N: 34        p (1-sided)   0.0013   0.5943
                  HR at bound   0.3306   1.0917
             P(Cross) if HR=1   0.0013   0.4057
           P(Cross) if HR=0.5   0.1412   0.0148
 IA 2: 67%                  Z   2.5465   0.9411
     N: 67        p (1-sided)   0.0054   0.1733
                  HR at bound   0.5158   0.7830
             P(Cross) if HR=1   0.0062   0.8347
           P(Cross) if HR=0.5   0.5815   0.0437
     Final                  Z   1.9992   1.9992
    N: 100        p (1-sided)   0.0228   0.0228
                  HR at bound   0.6542   0.6542
             P(Cross) if HR=1   0.0233   0.9767
           P(Cross) if HR=0.5   0.9000   0.1000
> # generate some of the above summary statistics for the upper bound
> z <- xs$upper$bound
> # B-values
> gsBValue(z=z, i=1:3, x=xs)
[1] 1.738251 2.079233 1.999226
> # hazard ratio
> gsHR(z=z, i=1:3, x=xs)
[1] 0.3521851 0.5357126 0.6702573
> # conditional power at observed treatment effect
> gsCPz(z=z[1:2], i=1:2, x=xs)
[1] 0.9999676 0.9737643
> # conditional power at H1 treatment effect
> gsCPz(z=z[1:2], i=1:2, x=xs, theta=xs$delta)
[1] 0.9937804 0.9809768
> 
> # information-based design
> xinfo <- gsDesign(delta=.3,delta1=.3)
> gsBoundSummary(xinfo, Nname="Information")
            Analysis                 Value Efficacy Futility
           IA 1: 33%                     Z   3.0107  -0.2387
  Information: 41.64           p (1-sided)   0.0013   0.5943
                            delta at bound   0.4666  -0.0370
                       P(Cross) if delta=0   0.0013   0.4057
                     P(Cross) if delta=0.3   0.1412   0.0148
           IA 2: 67%                     Z   2.5465   0.9411
  Information: 83.27           p (1-sided)   0.0054   0.1733
                            delta at bound   0.2791   0.1031
                       P(Cross) if delta=0   0.0062   0.8347
                     P(Cross) if delta=0.3   0.5815   0.0437
               Final                     Z   1.9992   1.9992
 Information: 124.91           p (1-sided)   0.0228   0.0228
                            delta at bound   0.1789   0.1789
                       P(Cross) if delta=0   0.0233   0.9767
                     P(Cross) if delta=0.3   0.9000   0.1000
> 
> # show all available boundary descriptions
> gsBoundSummary(xinfo, Nname="Information",exclude=NULL)
            Analysis                 Value Efficacy Futility
           IA 1: 33%                     Z   3.0107  -0.2387
  Information: 41.64           p (1-sided)   0.0013   0.5943
                            delta at bound   0.4666  -0.0370
                                  Spending   0.0013   0.0148
                                   B-value   1.7383  -0.1378
                                        CP   1.0000   0.0012
                                     CP H1   0.9938   0.4689
                                        PP   0.9897   0.0373
                       P(Cross) if delta=0   0.0013   0.4057
                     P(Cross) if delta=0.3   0.1412   0.0148
           IA 2: 67%                     Z   2.5465   0.9411
  Information: 83.27           p (1-sided)   0.0054   0.1733
                            delta at bound   0.2791   0.1031
                                  Spending   0.0049   0.0289
                                   B-value   2.0792   0.7684
                                        CP   0.9738   0.0713
                                     CP H1   0.9810   0.4223
                                        PP   0.9427   0.1157
                       P(Cross) if delta=0   0.0062   0.8347
                     P(Cross) if delta=0.3   0.5815   0.0437
               Final                     Z   1.9992   1.9992
 Information: 124.91           p (1-sided)   0.0228   0.0228
                            delta at bound   0.1789   0.1789
                                  Spending   0.0188   0.0563
                                   B-value   1.9992   1.9992
                       P(Cross) if delta=0   0.0233   0.9767
                     P(Cross) if delta=0.3   0.9000   0.1000
> 
> # add intermediate parameter value
> xinfo <- gsProbability(d=xinfo, theta=c(0,.15,.3))
> class(xinfo) # note this is still as gsDesign class object
[1] "gsDesign"
> gsBoundSummary(xinfo, Nname="Information")
            Analysis                  Value Efficacy Futility
           IA 1: 33%                      Z   3.0107  -0.2387
  Information: 41.64            p (1-sided)   0.0013   0.5943
                             delta at bound   0.4666  -0.0370
                        P(Cross) if delta=0   0.0013   0.4057
                     P(Cross) if delta=0.15   0.0205   0.1138
                      P(Cross) if delta=0.3   0.1412   0.0148
           IA 2: 67%                      Z   2.5465   0.9411
  Information: 83.27            p (1-sided)   0.0054   0.1733
                             delta at bound   0.2791   0.1031
                        P(Cross) if delta=0   0.0062   0.8347
                     P(Cross) if delta=0.15   0.1243   0.3523
                      P(Cross) if delta=0.3   0.5815   0.0437
               Final                      Z   1.9992   1.9992
 Information: 124.91            p (1-sided)   0.0228   0.0228
                             delta at bound   0.1789   0.1789
                        P(Cross) if delta=0   0.0233   0.9767
                     P(Cross) if delta=0.15   0.3636   0.6364
                      P(Cross) if delta=0.3   0.9000   0.1000
> 
> # now look at a binomial endpoint; specify H0 treatment difference as p1-p2=.05
> # now treatment effect at bound (say, thetahat) is transformed to 
> # xp$delta0 + xp$delta1*(thetahat-xp$delta0)/xp$delta  
> np <- nBinomial(p1=.15, p2=.10)
> xp <- gsDesign(n.fix=np, endpoint="Binomial", delta1=.05)
> summary(xp)
[1] "Asymmetric two-sided group sequential design with non-binding futility bound, 3 analyses, sample size 1963, 90 percent power, 2.5 percent (1-sided) Type I error. Efficacy bounds derived using a Hwang-Shih-DeCani spending function with gamma = -4. Futility bounds derived using a Hwang-Shih-DeCani spending function with gamma = -2."
> gsBoundSummary(xp,deltaname="p[C]-p[E]")
  Analysis                      Value Efficacy Futility
 IA 1: 33%                          Z   3.0107  -0.2387
    N: 655                p (1-sided)   0.0013   0.5943
                   p[C]-p[E] at bound   0.0778  -0.0062
              P(Cross) if p[C]-p[E]=0   0.0013   0.4057
           P(Cross) if p[C]-p[E]=0.05   0.1412   0.0148
 IA 2: 67%                          Z   2.5465   0.9411
   N: 1309                p (1-sided)   0.0054   0.1733
                   p[C]-p[E] at bound   0.0465   0.0172
              P(Cross) if p[C]-p[E]=0   0.0062   0.8347
           P(Cross) if p[C]-p[E]=0.05   0.5815   0.0437
     Final                          Z   1.9992   1.9992
   N: 1963                p (1-sided)   0.0228   0.0228
                   p[C]-p[E] at bound   0.0298   0.0298
              P(Cross) if p[C]-p[E]=0   0.0233   0.9767
           P(Cross) if p[C]-p[E]=0.05   0.9000   0.1000
> # estimate treatment effect at lower bound
> # by setting delta0=0 (default) and delta1 above in gsDesign
> # treatment effect at bounds is scaled to these differences
> # in this case, this is the difference in event rates
> gsDelta(z=xp$lower$bound, i=1:3, xp)
[1] -0.006166098  0.017187789  0.029813687
> 
> # binomial endpoint with risk ratio estimates
> n.fix<-nBinomial(p1=.3, p2=.15, scale="RR")
> xrr <- gsDesign(k=2,n.fix=n.fix,delta1=log(.15/.3),endpoint="Binomial")
> gsBoundSummary(xrr,deltaname="RR",logdelta=TRUE)
  Analysis              Value Efficacy Futility
 IA 1: 50%                  Z   2.7500   0.4122
    N: 168        p (1-sided)   0.0030   0.3401
                  RR at bound   0.4429   0.8851
             P(Cross) if RR=1   0.0030   0.6599
           P(Cross) if RR=0.5   0.3412   0.0269
     Final                  Z   1.9811   1.9811
    N: 336        p (1-sided)   0.0238   0.0238
                  RR at bound   0.6605   0.6605
             P(Cross) if RR=1   0.0239   0.9761
           P(Cross) if RR=0.5   0.9000   0.1000
> gsRR(z=xp$lower$bound, i=1:3, xrr)
[1] 1.0732500 0.8211496        NA
> plot(xrr,plottype="RR")
Error: Unknown colour name: 1
Execution halted