[Gsdesign-commits] r258 - in pkg: gsDesign gsDesign/R gsDesign/man gsDesignGUIReview/osx

noreply at r-forge.r-project.org noreply at r-forge.r-project.org
Mon Jan 18 03:48:10 CET 2010


Author: keaven
Date: 2010-01-18 03:48:05 +0100 (Mon, 18 Jan 2010)
New Revision: 258

Added:
   pkg/gsDesignGUIReview/osx/gsDesign_2.2-8.tar.gz
   pkg/gsDesignGUIReview/osx/gsDesign_2.2-8.zip
Modified:
   pkg/gsDesign/DESCRIPTION
   pkg/gsDesign/R/gsDesign.R
   pkg/gsDesign/R/gsqplot.R
   pkg/gsDesign/man/gsCP.Rd
   pkg/gsDesign/man/gsDesign.Rd
Log:
2.2-8 Added delta1, delta0 to gsDesign

Modified: pkg/gsDesign/DESCRIPTION
===================================================================
--- pkg/gsDesign/DESCRIPTION	2010-01-16 20:31:32 UTC (rev 257)
+++ pkg/gsDesign/DESCRIPTION	2010-01-18 02:48:05 UTC (rev 258)
@@ -1,5 +1,5 @@
 Package: gsDesign
-Version: 2.2-7
+Version: 2.2-8
 Title: Group Sequential Design
 Author: Keaven Anderson 
 Maintainer: Keaven Anderson <keaven_anderson at merck.com>

Modified: pkg/gsDesign/R/gsDesign.R
===================================================================
--- pkg/gsDesign/R/gsDesign.R	2010-01-16 20:31:32 UTC (rev 257)
+++ pkg/gsDesign/R/gsDesign.R	2010-01-18 02:48:05 UTC (rev 258)
@@ -120,14 +120,15 @@
 
 "gsDesign"<-function(k=3, test.type=4, alpha=0.025, beta=0.1, astar=0,  
         delta=0, n.fix=1, timing=1, sfu=sfHSD, sfupar=-4,
-        sfl=sfHSD, sflpar=-2, tol=0.000001, r=18, n.I=0, maxn.IPlan=0, nFixSurv=0, endpoint=NULL) 
+        sfl=sfHSD, sflpar=-2, tol=0.000001, r=18, n.I=0, maxn.IPlan=0, 
+        nFixSurv=0, endpoint=NULL, delta1=1, delta0=0) 
 {
     # Derive a group sequential design and return in a gsDesign structure
     
     # set up class variable x for gsDesign being requested
     x <- list(k=k, test.type=test.type, alpha=alpha, beta=beta, astar=astar,
             delta=delta, n.fix=n.fix, timing=timing, tol=tol, r=r, n.I=n.I, maxn.IPlan=maxn.IPlan,
-            nFixSurv=nFixSurv, nSurv=0, endpoint=endpoint)
+            nFixSurv=nFixSurv, nSurv=0, endpoint=endpoint, delta1=delta1, delta0=delta0)
     
     class(x) <- "gsDesign"
     
@@ -996,7 +997,7 @@
         
         if (x$n.I[x$k-1] >= x$maxn.IPlan)
         {
-            stop("maxn.IPlan must be > n.I[k-1]")        
+            stop("Only 1 n >= Planned Final n")        
         }
     }
     else if (x$maxn.IPlan > 0)

Modified: pkg/gsDesign/R/gsqplot.R
===================================================================
--- pkg/gsDesign/R/gsqplot.R	2010-01-16 20:31:32 UTC (rev 257)
+++ pkg/gsDesign/R/gsqplot.R	2010-01-18 02:48:05 UTC (rev 258)
@@ -65,18 +65,19 @@
 }
 "plotgsZ" <- function(x, ylab="Normal critical value",main="Normal test statistics at bounds",...){qplotit(x=x,ylab=ylab,main=main,fn=function(z,...){z},...)}
 "plotBval" <- function(x, ylab="B-value",main="B-values at bounds",...){qplotit(x=x, fn=gsBvalue, ylab=ylab,main=main,...)}
-"plotreleffect" <- function(x=x, ylab=NULL, delta=1, main="Treatment effect at bounds", delta0=ifelse(is.null(x$delta0),0,x$delta0),...){qplotit(x, fn=gsDeltaHat, main=main, ylab=ifelse(!is.null(ylab), ylab, expression(hat(theta)/theta[1])), delta=delta, delta0=delta0,...)}
+"plotreleffect" <- function(x=x, ylab=NULL, main="Treatment effect at bounds",...){
+    qplotit(x, fn=gsDeltaHat, main=main, ylab=ifelse(!is.null(ylab), ylab, 
+            ifelse(tolower(x$endpoint)=="binomial",
+                   expression(hat(p)[C]-hat(p)[E]), 
+                   expression(hat(theta)/theta[1]))),...)
+}
 "plotHR" <- function(x=x, ylab="Estimated hazard ratio",main="Hazard ratio at bounds",...){qplotit(x, fn=gsHRHat, ylab=ylab,main=main,...)}
 gsBvalue <- function(z,i,x,ylab="B-value",...)
 {   Bval <- z * sqrt(x$timing[i])
     Bval
 }
-gsThetaHat <- function(z, i, x, ylab=NULL,...)
-{   thetaHat <- z / sqrt(x$n.I[i])/x$delta
-    thetaHat
-}
-gsDeltaHat <- function(z, i, x, delta, delta0=0, ylab=NULL,...)
-{   deltaHat <- z / sqrt(x$n.I[i]) * delta / x$delta - delta0
+gsDeltaHat <- function(z, i, x, ylab=NULL,...)
+{   deltaHat <- z / sqrt(x$n.I[i]) * x$delta1 / x$delta - x$delta0
     deltaHat
 }
 gsHRHat <- function(z, i, x, ratio, ylab="Estimated hazard ratio",...)

Modified: pkg/gsDesign/man/gsCP.Rd
===================================================================
--- pkg/gsDesign/man/gsCP.Rd	2010-01-16 20:31:32 UTC (rev 257)
+++ pkg/gsDesign/man/gsCP.Rd	2010-01-18 02:48:05 UTC (rev 258)
@@ -54,6 +54,8 @@
 Jennison C and Turnbull BW (2000), \emph{Group Sequential Methods with Applications to Clinical Trials}.
 Boca Raton: Chapman and Hall.
 
+Proschan, Michael A., Lan, KK Gordon and Wittes, Janet Turk (2006), \emph{Statiscal Monitoring of Clinical Trials}. NY: Springer.
+
 Muller, Hans-Helge and Schaffer, Helmut (2001), Adaptive group sequential designs for clinical trials:
 combining the advantages of adaptive and classical group sequential approaches. \emph{Biometrics};57:886-891. 
 }
@@ -65,8 +67,9 @@
 
 # set up a prior distribution for the treatment effect
 # that is normal with mean .75*x$delta and standard deviation x$delta/2
-prior <- normalGrid(mu=.75*x$delta, sigma=x$delta/2)
-names(prior)
+mu0 <-.75*x$delta
+sigma0 <- x$delta/2
+prior <- normalGrid(mu=mu0, sigma=sigma0)
 
 # compute POS for the design given the above prior distribution for theta
 gsPOS(x=x, theta=prior$z, wgts=prior$wgts)
@@ -92,7 +95,6 @@
 # if it is known that boundary not crossed at interim 2, use
 # gsCPOS to compute conditional POS based on this
 gsCPOS(x=x, i=2, theta=prior$z, wgts=prior$wgts)
-}
 
 # 2-stage example to compare results to direct computation
 x<-gsDesign(k=2)
@@ -102,11 +104,26 @@
 thetahat<-z1/sqrt(n1)
 theta<-c(thetahat, 0 , x$delta)
 
-# conditional power direct computation
-pnorm((n2*theta+z1*sqrt(n1)-z*sqrt(n1+n2))/sqrt(n2))
+# conditional power direct computation - comparison w gsCP
+pnorm((n2*theta+z1*sqrt(n1)-x$upper$bound[2]*sqrt(n1+n2))/sqrt(n2))
+
 gsCP(x=x, zi=z1, i=1)$upper$prob
 
+# predictive power direct computation - comparison w gsPP
+# use same prior as above
+mu0 <- .75 * x$delta * sqrt(x$n.I[2])
+sigma2 <- (.5 * x$delta)^2 *  x$n.I[2]
+prior <- normalGrid(mu=.75 * x$delta, sigma=x$delta/2)
+gsPP(x=x, zi=z1, i=1, theta=prior$z, wgts=prior$wgts)
+t <- .5
+z1 <- .5
+b <- z1 * sqrt(t)
+# direct from Proschan, Lan and Wittes eqn 3.10
+# adjusted drift at n.I[2]
+pnorm(((b - x$upper$bound[2]) * (1 + t * sigma2) +
+        (1 - t) * (mu0 + b * sigma2)) /
+      sqrt((1 - t) * (1 + sigma2) * (1 + t * sigma2)))
+}
 
-
 \seealso{\code{\link{gsDesign}}, \code{\link{gsProbability}}, \code{\link{gsBoundCP}}}
 \keyword{design}

Modified: pkg/gsDesign/man/gsDesign.Rd
===================================================================
--- pkg/gsDesign/man/gsDesign.Rd	2010-01-16 20:31:32 UTC (rev 257)
+++ pkg/gsDesign/man/gsDesign.Rd	2010-01-18 02:48:05 UTC (rev 258)
@@ -7,7 +7,7 @@
 gsDesign(k=3, test.type=4, alpha=0.025, beta=0.1, astar=0,  
          delta=0, n.fix=1, timing=1, sfu=sfHSD, sfupar=-4,
          sfl=sfHSD, sflpar=-2, tol=0.000001, r=18, n.I = 0,
-         maxn.IPlan = 0, nFixSurv=0, endpoint=NULL) 
+         maxn.IPlan = 0, nFixSurv=0, endpoint=NULL, delta1=1, delta0=0) 
 
 print.gsDesign(x,...)}
 
@@ -25,7 +25,7 @@
 	probability of crossing a lower bound at all analyses combined. 
 	This will be changed to \eqn{1 - }\code{alpha} when default value of 0 is used. 
 	Since this is the expected usage, normally \code{astar} is not specified by the user.}
-	\item{delta}{Standardized effect size. See details and examples.}
+	\item{delta}{Standardized effect size for theta under alternative hypothesis. See details and examples.}
 	\item{n.fix}{Sample size for fixed design with no interim; used to find maximum group sequential sample size. For a time-to-event outcome, input number of events required for a fixed design rather than sample size
 and enter fixed design sample size (optional) in \code{nFixSurv}.
 	See details and examples.}
@@ -60,8 +60,12 @@
 	compute the total sample size required as well as the number of events at each analysis that will be returned in \code{n.fix}; this is rounded up to an even number.}|
 	\item{x}{In \code{print.gsDesign} this is an object of class gsDesign.}
 	\item{...}{This should allow optional arguments that are standard when calling \code{print}.}
-\code{endpoint}{An optional character string that should represent the type of endpoint used for the study. This may be used by output functions. Types most likely to be recognized initially are "TTE" for time-to-event outcomes with fixed design sample size generated by \code{nSurvival()} and "Binomial" for 2-sample binomial outcomes with fixed design sample size generated by \code{nBinomial()}.
-}}
+
+	\item{endpoint}{An optional character string that should represent the type of endpoint used for the study. This may be used by output functions. Types most likely to be recognized initially are "TTE" for time-to-event outcomes with fixed design sample size generated by \code{nSurvival()} and "Binomial" for 2-sample binomial outcomes with fixed design sample size generated by \code{nBinomial()}.}
+
+	\item{delta1}{\code{delta1} and \code{delta0} may be used to store information about the natural parameter scale compared to \code{delta} that is a standardized effect size. \code{delta1} is the alternative hypothesis parameter value on the natural scale (e.g., the difference in two binomial rates).}
+	\item{delta0}{The parameter value under the null hypothesis on the natural parameter scale. Default is 0, which might normally be interpreted as no difference between two treatment groups. If non-zero, this would normally represent a non-inferiority margin.}
+}
 \value{
 An object of the class \code{gsDesign}. This class has the following elements and upon return from 
 \code{gsDesign()} contains:
@@ -91,6 +95,8 @@
 If \code{delta=0} and \code{n.fix=1} then this is the relative sample size compared to a fixed design; see details and examples.}
 \item{maxn.IPlan}{As input.}
 \item{endpoint}{As input.}
+\item{delta1}{As input.}
+\item{delta0}{As input.}
 }
 \details{
 Many parameters normally take on default values and thus do not require explicit specification.

Added: pkg/gsDesignGUIReview/osx/gsDesign_2.2-8.tar.gz
===================================================================
(Binary files differ)


Property changes on: pkg/gsDesignGUIReview/osx/gsDesign_2.2-8.tar.gz
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: pkg/gsDesignGUIReview/osx/gsDesign_2.2-8.zip
===================================================================
(Binary files differ)


Property changes on: pkg/gsDesignGUIReview/osx/gsDesign_2.2-8.zip
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream



More information about the Gsdesign-commits mailing list